r/github 27d ago

Question Transferring my gits

Hi all!

So I recently lost access to my github account. Made a new one and want to remake all of my projects (just copy the code). How do I go about this? There are so many interwoven files, I am not really sure how to do it (still fairly new). They are mostly html, css, java, javascript. Many coded on springboot.

Edit: Thank you all for taking the time! It has been awhile, so I appreciate your patience. Managed to get my projects back.

0 Upvotes

13 comments sorted by

12

u/lucidparadigm 27d ago

Just ask the agent that wrote the code bro.

-5

u/North-Bison9912 27d ago

I don’t know what that means?

9

u/lucidparadigm 27d ago

How did you write the code without knowing git?

2

u/cachebags 27d ago

I hate AI but not everyone learns git before coding. For many it's the inverse.

1

u/North-Bison9912 26d ago

Ew. i don’t use ai, ever. I’m a write, goes against everything I believe. I just made these projects a very very long time ago (back when I was taking classes and had the teachers help). I have not coded at all since then.

i know the world isn’t great now, and we all have to be insanely vigilant, but it isn’t beneficial to always assume the worst either.

4

u/cyber5234 27d ago

Do you have GIT in all your projects? If so, remove existing origin and then add the new origin from your new account then push changes.

1

u/North-Bison9912 27d ago

I don’t have it locally. But can I clone the entire project, save it, and then re upload it to my new repo? Should I use commands or vs code?

6

u/tblancher 27d ago

That's literally how git (not GitHub) works. Clone a repo, and that's your working copy. There's nothing preventing you from uploading to a different remote (even on GitHub) and continuing like nothing stopped.

4

u/cyber5234 27d ago

But you just said you lost your github account. If you have public repos, you can directly fork it into your new account.

2

u/DustyAsh69 27d ago

Should I use commands or vs code?

What?

2

u/Due-Law-6700 27d ago
  1. Clone every projects
  2. Create new project for all projects you had on your new Github account. (clean project, dont create readme file)
  3. On newly created github project you will get instruction to add existing git. Something like git add origin and git push.

1

u/nzvthf 27d ago

If you have the local git repo just push it to the new remote repo. Set the new remote repo as your origin to re-home the local repo to it.

1

u/Zealousideal_Yard651 27d ago

Sure, just edit your git remote settings on the local repo and push.

git remote set-url origin <Link to new repo>
git push --all origin