I have an assignment project which was created by GitHub Classroom and is also private. So how to transfer my project to my personal account with all existing commits?
Asked
Active
Viewed 1,564 times
1 Answers
2
[Step 1]
Go to Github classroom private repo and clone the git URL from [code]
Open cmd from the parent folder
git clone --bare _____(clone URL)
[--bare => clone with all commits]open the cloned folder from explorer
[Step 2]
Create a new repo
Just copy the origin URL
git push --mirror _____(origin url)
[--mirror => transfer all commits]
[Step 3]
- Change origin [otherwise new code will push to the previous git location]
git remote -v
[checking remote version]git remote set-url origin _____(origin URL)
git remote -v
Examples
git clone --bare https://github.com/your-assignment-project.git
git push --mirror https://github.com/your-personal-repo.git
git remote set-url origin https://github.com/your-personal-repo.git
git remote -v

nurmdrafi
- 419
- 4
- 11