'How to transfer GitHub classroom private repo to my GitHub repo?
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?
Solution 1:[1]
[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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | nurmdrafi |