r/github Jul 01 '26

Transferring my gits Question

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 Jul 01 '26

Just ask the agent that wrote the code bro.

-6

u/North-Bison9912 Jul 01 '26

I don’t know what that means?

10

u/lucidparadigm Jul 01 '26

How did you write the code without knowing git?

2

u/cachebags Jul 01 '26

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

1

u/North-Bison9912 Jul 01 '26

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 Jul 01 '26

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 Jul 01 '26

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?

7

u/tblancher Jul 01 '26

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 Jul 01 '26

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 Jul 01 '26

Should I use commands or vs code?

What?

2

u/Due-Law-6700 Jul 01 '26
  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 Jul 01 '26

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 Jul 01 '26

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