bixiaopeng@bixiaopengtekiMacBook-Pro xmrobotium$ git branch
* master
bixiaopeng@bixiaopengtekiMacBook-Pro xmrobotium$ git branch xm2.x
bixiaopeng@bixiaopengtekiMacBook-Pro xmrobotium$ git checkout xm2.x
bixiaopeng@bixiaopengtekiMacBook-Pro xmrobotium$ git checkout -b xm2.x
bixiaopeng@bixiaopengtekiMacBook-Pro xmrobotium$ git branch
* master
xm2.x
bixiaopeng@bixiaopengtekiMacBook-Pro xmrobotium$ git add bixiaopeng.txt
bixiaopeng@bixiaopengtekiMacBook-Pro xmrobotium$ git add .
bixiaopeng@bixiaopengtekiMacBook-Pro xmrobotium$ git commit -m "bixiaopeng test case"
bixiaopeng@bixiaopengtekiMacBook-Pro xmrobotium$ git commit -a -m "xm2.x test case"
[xm2.x f78f430] xm2.x test case
39 files changed, 384 insertions(+)
create mode 100644 AndroidManifest.xml
………….
bixiaopeng@bixiaopengtekiMacBook-Pro xmrobotium$ git diff
bixiaopeng@bixiaopengtekiMacBook-Pro xmrobotium$ git push origin xm2.x
Counting objects: 78, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (51/51), done.
Writing objects: 100% (77/77), 565.97 KiB, done.
Total 77 (delta 3), reused 0 (delta 0)
remote: To [email protected].*****.com:/home/git/repositories/xiaopeng.bxp/xmrobotium.git
remote: * [new branch] xm2.x -> xm2.x
To git@gitlab.****.com:xiaopeng.bxp/xmrobotium.git
* [new branch] xm2.x -> xm2.x
bixiaopeng@bixiaopengtekiMacBook-Pro xmrobotium$ git branch -r
origin/master
origin/xm2.x
bixiaopeng@bixiaopengtekiMacBook-Pro xmrobotium$ git branch -a
master
* xm2.x
remotes/origin/master
remotes/origin/xm2.x
bixiaopeng@bixiaopengtekiMacBook-Pro xmrobotium$ git branch -m xm2.x test2.x
bixiaopeng@bixiaopengtekiMacBook-Pro xmrobotium$ git branch -r
origin/master
origin/xm2.x
bixiaopeng@bixiaopengtekiMacBook-Pro xmrobotium$ git branch -a
master
* test2.x
remotes/origin/master
remotes/origin/xm2.x
bixiaopeng@bixiaopengtekiMacBook-Pro xmrobotium$ git push origin --delete xm2.x
remote: To [email protected].****.com:/home/git/repositories/xiaopeng.bxp/xmrobotium.git
remote: - [deleted] xm2.x
To git@gitlab.*****.com:xiaopeng.bxp/xmrobotium.git
- [deleted] xm2.x
bixiaopeng@bixiaopengtekiMacBook-Pro xmrobotium$ git branch -r
origin/master
origin/test2.x
首先切换到想要合并到的分枝下,运行'git merge’命令 (例如本例中将test2.x分支合并到xm3.0分支的话,进入xm3.0分支运行git merge test2.x命令)如果合并顺利的话:
bixiaopeng@bixiaopengtekiMacBook-Pro xmrobotium$ git status
On branch xm3.0
nothing to commit, working directory clean
bixiaopeng@bixiaopengtekiMacBook-Pro xmrobotium$ git branch
master
test2.x
* xm3.0
bixiaopeng@bixiaopengtekiMacBook-Pro xmrobotium$ git merge test2.x
Already up-to-date.
Automatic merge failed; fix conflicts and then commit the result.
修改冲突的文件后,git add 文件 然后,git commit
作者: 毕小朋 | 老 毕 邮箱: [email protected]
微博: @WirelessQA 博客: http://blog.csdn.net/wirelessqa