1.git 提交代码 最好切到要提交代码的分支(即当前切出来的分支)上
- git fetch 如果有改动 git pull
- commit //提交
- git push //push
2 文件从一个分支合并另一个分支上
zabbix-new 上的文件和到 dev
1.git checkout dev //切到另一个分支上dev
2. git pull //更新
3. git merge zabbix-new merge //
提示。表示User.xml 文件合并到 dev上了
Updating 799c6195..ab162f27 Fast-forward douc-api/src/main/resources/com.cloudwise.douc.user.dao.xml/User.xml | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-)
3经常出现这个提示怎么解决
error: Your local changes to the following files would be overwritten by checkout:
douc-standalone/conf/application.conf
Please commit your changes or stash them before you
这里意思你有变动
保留本地的修改 的改法——通过git stash
1.git stash list
2.git stash save var
提示
Saved working directory and index state On zabbix-new: var
后可以进行其他操作