https://help.github.com/articles/generating-ssh-keys#platform-linux
https://help.github.com/articles/create-a-repo
(local unchanged, remote changed.)
$ git remote add origin [email protected]:username/project.git
$ git pull origin master
[#]succeed
(local changed, remote unchanged.)
$ git add .
$ git commit -m "local commit"
$ git remote add origin [email protected]:username/project.git
$ git push origin master
[#]succeed
(local changed, remote changed.)
$ git add .
$ git commit -m "local commit"
$ git remote add origin [email protected]:username/project.git
$ git push origin master
! [rejected]
$ git pull origin master
CONFLICT (content)
你的源码文件内容会变为:
<<<<<<< HEAD your commit ======= remote repository >>>>>>> master
直接在源码文件内人为取舍代码。
然后再push:
$ git add .
$ git commit -m "local commit"
$ git push origin master
$ git clone git://github.com/username/project.git
这种情况下是不能push的。
参考:
Git/Github使用方法小记
http://artori.us/git-github-usage/
git - 简易指南
http://rogerdudler.github.io/git-guide/index.zh.html
如何高效利用GitHub - 阳志平
http://www.yangzhiping.com/tech/github.html
Pro Git book
http://git-scm.com/book/zh