1、git的初始设置
git config --global user.name "youname"
git config --global user.email youemail
2、建立仓库
git init
3、初始化项目
http://github.org
5、创建SSH密匙
7、上传代码
git remote add origin [email protected]:你的github用户名/你的github项目名.git
8、操作完毕,打完收工
如何建立自己的分支:
# 分支的创建和合并
# git branch yourbranch
# git checkout yourbranch 切换到yourbranch
# 开发yourbranch分支,然后开发之后与master分支合并
#
git checkout master
# git merge yourbranch
# git branch -d yourbranch 合并完后删除本地分支
如何将牛人的远程分支更新到自己的本地分支?
# 查看当前项目下远程
# git remote
# 增加新的分支链接,例如
# git remote add niuren giturl…
# 获取牛人的远程更新
# git fetch niuren
# 将牛人的远程更新合并到本地分支
# git merge niuren/master
以上来源于http://www.yangzhiping.com/tech/github.html
跟踪远程分支:
git checkout -b [分支名] [远程名]/[分支名]