如何把本地写好的一个工程上传到Github?

2017-03-01  本文已影响162人  kakukeme

如何把本地写好的一个工程上传到Github?
http://blog.csdn.net/frivol/article/details/45103191?ref=myread

从零开始学Git|手把手教你创建Project提交到Github
http://www.imooc.com/article/10769

如何解决failed to push some refs to git
http://jingyan.baidu.com/article/f3e34a12a25bc8f5ea65354a.html

http://blog.csdn.net/hudashi/article/details/7664631/
git rebase用于把一个分支的修改合并到当前分支。

$ git init

$ git remote add origin https://github.com/kakukeme/angularJS-demo.git

$ git add .

$ git commit -m 'first commit'

$ git push -u origin master
To https://github.com/kakukeme/angularJS-demo.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/kakukeme/angularJS-demo.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
kokiadeiMac:angularJS-demo kokia$ git status
On branch master
nothing to commit, working tree clean

$ git pull --rebase origin master

$ git push -u origin master
counting objects: 52, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (51/51), done.
Writing objects: 100% (52/52), 628.15 KiB | 0 bytes/s, done.
Total 52 (delta 5), reused 0 (delta 0)
remote: Resolving deltas: 100% (5/5), done.
To https://github.com/kakukeme/angularJS-demo.git
   3007b4b..b8fecf6  master -> master
Branch master set up to track remote branch master from origin.


上一篇 下一篇

猜你喜欢

热点阅读