`

git 常用命令

    博客分类:
  • git
 
阅读更多

git

https://github.com/jiandanlicai/earth/blob/master/flow.md

git checkout branch_name 切换分支

git new-ib issue#4  新建分支

commit 时 只需要输入#和对应的编号 不需要加issue前缀

 

如果是基于一个分支创建新的分支

git checkout branch_name 切换到基础版本分支上

git branch new_branch_name 新建立新的分支

 

当发现本地版本落后于基础版本时,执行如下操作

git fech ;  //更新本地的master
git merge origin/master ; //将更新过来的master合并到当前分支

 

此时会报错误

error: Your local changes to the following files would be overwritten by merge:
        protected/config/main.php
Please, commit your changes or stash them before you can merge.

 然后执行

git stash save your-file-name
git merge origin/master
//此时会报出未合并的错误,进行代码合并修改之后
git stash pop
git add , commit , push
然后再
git merge origin/master

 

 

 

当执行git status时,发现有大量文件不同,切git diff时 大部分文件都显示

old mode 100755  
new mode 100644

 

那么此时,可以执行

git config core.filemode false 

再查看状态时便恢复正常

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics