Git 分支管理

The only theory, the purpose of life is building a paradise on earth in the earth.


在分支有改动后,提交:

git commit -m "changeDev"

然后换到主线上:

git checkout master

换到主线后,看看在分支修改的内容已经没有了,这个时候再换到分支上:

git checkout dev

会出现 错误

error: Your local changes to the following files would be overwritten by checkout:
QianTuMei.xcworkspace/xcuserdata/weiyuxiang.xcuserdatad/UserInterfaceState.xcuserstate
Please commit your changes or stash them before you switch branches.

需要: git add QianTuMei.xcworkspace/xcuserdata/weiyuxiang.xcuserdatad/UserInterfaceState.xcuserstate

然后再push上去:

git push origin dev

创建分支 : git branch xxx

查看当前主线:git branch ,前面带 * 为当前主线