git使用方法的详细教程
2017-07-20 18:48
417 查看
cd进入到你需要提交到的目标目录下
然后将本地文件cp到当前目录cp /home/zhou/Code/qingstor-sdk-java/docs/template/ ./ -r(-r表示递归)
将本地文件add到目标目录git add 本地文件
提交 git commit -m "commit目的"
最后使用git push提交
创建新分支:git branch name
切换到当前新建分支下:gti checkout name
提交:git push --set-upstream origin name
push错误信息
To git@github.com:Eritic/qingstor-sdk-java.git
! [rejected] update-docs -> update-docs (non-fast-forward)
error: failed to push some refs to 'git@github.com:Eritic/qingstor-sdk-java.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 push -f进行强制push
git commit --amend 修改branch最开始的commit
git log 打印commit的log message
git rebase -i HEAD~N commit merge
场景如下:假如我们使用"git add filename,git commit -m " message" ",但是在你push之前需要修改这个file,那么我们此时只需要使用"git commit -amend"然后再退出就好了,这样就会将我们修改的file保存下来,最后push一一下就好
然后将本地文件cp到当前目录cp /home/zhou/Code/qingstor-sdk-java/docs/template/ ./ -r(-r表示递归)
将本地文件add到目标目录git add 本地文件
提交 git commit -m "commit目的"
最后使用git push提交
创建新分支:git branch name
切换到当前新建分支下:gti checkout name
提交:git push --set-upstream origin name
push错误信息
To git@github.com:Eritic/qingstor-sdk-java.git
! [rejected] update-docs -> update-docs (non-fast-forward)
error: failed to push some refs to 'git@github.com:Eritic/qingstor-sdk-java.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 push -f进行强制push
git commit --amend 修改branch最开始的commit
git log 打印commit的log message
git rebase -i HEAD~N commit merge
场景如下:假如我们使用"git add filename,git commit -m " message" ",但是在你push之前需要修改这个file,那么我们此时只需要使用"git commit -amend"然后再退出就好了,这样就会将我们修改的file保存下来,最后push一一下就好
相关文章推荐
- Git使用详细教程
- 最详细的Cydia使用教程------完全版。新补充Cydia1.1.1离线安装(升级)方法。
- Ant教程-详细使用方法
- Git使用详细教程
- Git可视化极简易教程 — Git GUI使用方法
- Git使用详细教程
- Ant教程-详细使用方法
- 菜鸟好文推荐(十六)——Git使用详细教程
- Git使用详细教程
- Git可视化极简易教程 —— Git GUI使用方法
- 一键GHOST V8.3 Build 060425 硬盘版一键ghost使用方法说明[图文详细教程]
- Win Vista使用教程之UAC详细使用方法
- git安装教程和使用方法记录
- SecureCRT的使用方法和技巧(详细使用教程)
- windows安装To 4000 rtoiseGit详细使用教程【基础篇】
- Git使用详细教程
- Ant教程-详细使用方法
- Git使用详细教程
- SecureCRT的使用方法和技巧(详细使用教程)
- Git使用详细教程