Showing posts with label git. Show all posts
Showing posts with label git. Show all posts

Tuesday, February 24, 2009

git 之目录

在本地 local 目录 git init
然后在本地 remote 目录 git init

cd local #developer’s local repository
git pull ../remote master #get the latest code from ‘remote’ repository
git push ../remote master #push the recent commits from here to the ‘remote’ folder 
使用Git remote命令
GitHub 所用的方式比较方便,就像这样:
git remote add origin ../remote/ #one time for all
git pull origin master # pull from the ‘remote’ directory
git push origin master #push recent commits from here to the ‘remote’ folder 
Git加ssh
如果有一个 ssh 帐号的话,那么可以在远程机器上做 git 仓库,那么就可以随时随地的同步了。
git remote add origin ssh://jesper@myserver.com/~/project.git/

在 ssh 机器上设置一下:

$ ssh jesper@myserver.com
Welcome to myserver.com!
$ mkdir project.git && cd project.git/
$ git –bare init
Initialized empty Git repository in /home/jesper/project.git
$ exit
Bye!

git 配合有了 pub/priv KEY 的 ssh,会让人觉得生活很美好。
你觉得呢?


参考:
Using Local File-based Git — Server Laziness