Lokales Git Repository auf einen Server verschieben

Damit ich nicht jedes mal Googlen muss (und für euch paar da draussen die auf diesen Post über Google oder so stolperln) gibts heute ein kleines Tutorial zu wie man ein lokales Git Repository auf einen (Linux/*nix/…) Server kopiert und dann das lokale Repository auf den entfernten Server einstellt.

Als erstes erstellen wir auf dem Server ein leeres Repository

besn@daedalus:~$ mkdir -p ~/git/lerl
besn@daedalus:~$ cd ~/git/lerl/
besn@daedalus:~/git/lerl$ git init --shared --bare
Initialized empty shared Git repository in /home/besn/git/lerl/

Dann stellen wir in dem lokalen Repository den Server als Remote Ziel ein

besn@odyssey:~/lerl$ git remote add origin besn.at:~/git/lerl
besn@odyssey:~/lerl$ git push origin master
Counting objects: 50, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (43/43), done.
Writing objects: 100% (50/50), 95.98 KiB, done.
Total 50 (delta 2), reused 0 (delta 0)
To besn.at:~/git/lerl
 * [new branch]      master -> master
This entry was posted in andi.priv.at and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>