Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1627196
  • 博文数量: 126
  • 博客积分: 1541
  • 博客等级: 上尉
  • 技术积分: 1914
  • 用 户 组: 普通用户
  • 注册时间: 2012-05-20 11:14
文章分类

全部博文(126)

文章存档

2014年(21)

2013年(42)

2012年(63)

分类: 嵌入式

2012-08-31 09:46:16

每次修改程序时
最好先同步代码,在最新的代码上修改,这样提交时就不会有冲突
git fetch origin 
git reset --hard m/master
在切换到到要修改的分支上
git checkout -b RL_master m/master

但是有时没有同步也没有切换分支,提交时发现都没有 分支 怎么办呢?
git checkout RL_master 
出现下面以打印信息:
Warning: you are leaving 1 commit behind, not connected to
any of your branches:

  ccf1f7b add new app for e675-16-ts

If you want to keep them by creating a new branch, this may be a good time
to do so with:

 git branch new_branch_name ccf1f7b128d16d7b85d57acc9e251d9390a75467

Switched to branch 'RL_master'
Your branch is behind 'origin/RL_master' by 41 commits, and can be fast-forwarded.
接着
 git branch a  ccf1f7b128d16d7b85d57acc9e251d9390a75467
然后再切换到分支:
git checkout RL_master

git fetch origin
git reset --hard m/master
git cherry-pick ccf1f7b128d16d7b85d57acc9e251d9390a75467
或者 git merge a也可以



阅读(2973) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~