master
分支的最新修改推送至远端 (如GitHub))Username for 'https://github.com': yjlgithup To https://github.com/yjlgithup/bu.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/yjlgithup/bu.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.
若是出错:git pull --rebase origin mastergit
提交代码到远程分支github
1.git checkout -b ' two ' (切换并建立一个分支)缓存
2.git add . (提交分支代码)服务器
3.git commit -m '' (提交 修改信息)学习
4.git remote add origin http://.... (链接远程仓库)fetch
5.git pull origin master (从新拉一边代码)spa
6.git push origin two (提交分支代码)code
githup 上面会出现你心建立的分支,而且提交的代码blog
拉取分支代码到本地教程
当我想从远程拉取到一条本地不存在的分支 代码
1.git init (初始化)
2.git remote add origin http://.... (链接远程仓库)
3.git clone (首次拉取代码)
4.git pull origin master
5.git fetch
6.git checkout -b (本地分支名称 two )origin/(远程分支名称 two)
推荐学习资料:
廖雪峰的官方教程Git http://www.liaoxuefeng.com/wiki/Git