【发布时间】:2017-08-02 01:09:39
【问题描述】:
我问这个问题是因为我有点困惑(只是有点)。
当我使用 Pycharm (在除 master 之外的分支上) 时,它为我提供了提交分支的更改并将其推送到 github 的机会。
所以我就这么做了。
现在...
之后,我运行这个:
current branch *test
1.git pull origin master
2.git checkout master
3.git merge test
在1. 上,它告诉我一切都是最新的。然后转到3.,它还告诉我master 是最新的。
问题:
- 当我将分支提交到 github 时会发生什么?
- 将分支推送到 master 后是否必须运行上面的代码块?
编辑
- 我从
master branch开始 - 我运行
git checkout test。
出现一条消息。
switched to branch test. your branch is ahead of origin/test by 3 commits.
(use "git push" to publish your local commits)
- 我运行命令
git pull origin master
会出现一条消息,其中包含多行显示正在更新的分支。
-
我重新运行命令
git pull origin master一条来自http://github.com/username/project的消息出现
- 分支主-> FETCH_HEAD 已经是最新的
我按下绿色按钮提交更改并推送。出现一个弹出窗口
nothing to commit我运行命令
git checkout master
您的分支已经与 origin/master 保持同步
-
我运行命令
git merge test所有最新的!!!
那为什么是git merge test?
【问题讨论】:
标签: git github git-branch git-push