[CSC 415] Moving entire Gitlab repositories to Github

Andrew J. Pounds pounds_aj at mercer.edu
Sat Apr 1 08:40:22 EDT 2017


So some of you have asked about this so you can build your interview 
portfolios.   I just tried this and was able to move the entire Game of 
Drones  (all 27 branches) with all of the subdirectories to my Github 
account using the following procedure.

Again -- this is only for moving stuff over for your interview 
porfolios.  All class-related code development should remain on Gitlab.

The account names used below are mine on Gitlab and Github (you should 
recognize them from class) and I am going to demonstrate moving the Game 
of Drones repository.  It should be obvious where you have to substitute 
your usernames or you own repo names when you actually want to do this.

Here we go..

1. Get onto a unix/linux system where you have your Gitlab and Github 
ssh keys configured

2. Change to the /tmp directory and clone the repository using some 
additional options

cd /tmp

git clone --mirror git at gitlab.cs.mercer.edu:pounds-courses/gofd.git gofd


-- notice that at the end of the command I also included the name of the 
directory.  This has to be done with the mirror command so that it will 
create the directory without the .git extension.

3. Log onto Github and create the new repo.

createrepo1

ON THE SECOND PAGE ALL WE NEED IS THE NAME THAT GITHUB CREATED FOR OUR 
REPO...

repor2

4. Now that we know github has set aside the name 
git at github.com:/drlbs/gofd.git for our repo, we need to point our 
current repo to it. Back in your unix command line type

cd ./gofd

git remote add github git at github.com:drlbs/gofd.git


5. Finally, we need to tell git to push everything to the new remote

git push --mirror github


And that should do it.  Try it out with your own repositories and let me 
know how it goes.

-- 
Andrew J. Pounds, Ph.D.  (pounds_aj at mercer.edu)
Professor of Chemistry and Computer Science
Mercer University,  Macon, GA 31207   (478) 301-5627
http://faculty.mercer.edu/pounds_aj

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://theochem.mercer.edu/pipermail/csc415/attachments/20170401/c3c20201/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: create_repo1.png
Type: image/png
Size: 86536 bytes
Desc: not available
URL: <http://theochem.mercer.edu/pipermail/csc415/attachments/20170401/c3c20201/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: repocreate2.png
Type: image/png
Size: 114222 bytes
Desc: not available
URL: <http://theochem.mercer.edu/pipermail/csc415/attachments/20170401/c3c20201/attachment-0003.png>


More information about the csc415 mailing list