Reputation: 89
I have an ongoing project at my university working as part of a professor's research group. Up until now, I have been using a private repository on my personal Github account to store my work (on github.com/user/repo
). However, my university also has a separate enterprise Github server, and my professor wants me to also store my work on the university's server (github.university.com/user/repo
) since that will make handing off the project easier once I leave the group, among other reasons. The issue is that I already have a lot of work done in my personal repo, and I'd like to be able to see it after I'm no longer a student (which will be soon).
My professor doesn't care if I keep my work in my personal repository, as long as it is also tracked in the university Github.
I want to know: is there a way to link my existing, private repository to a repository in my university's enterprise Github server? I'd like to:
git push
to push changes to github.university.com/user/repo
and github.com/user/repo
at once)Beyond simple branching and merging, I'm not great with git, and this sort of niche use-case feels above my pay grade. Thank you in advance!
Upvotes: 0
Views: 52
Reputation: 534950
is there a way to link my existing, private repository to a repository in my university's enterprise Github server
Absolutely. Just add it as a remote:
git remote add uni <universityURL>
Now when you say
git push origin mybranch
you are pushing the branch to your repo, but when you say
git push uni mybranch
you are pushing it to the university repo.
(I use this technique all the time, as a backup to my backup. What if GitHub goes down? It does happen. So I also have a Bitbucket account, and I push to both, figuring they won't both be down at once.)
Upvotes: 3