For example, branch master and branch dev have a file file.ext at the same time. I updated (commit & push) this file on branch dev. How can I update the file on branch master when my colleagues update?
我想大声告诉你2017-05-02 09:25:24
The solution I gave is not automatic and requires manual operation. It should not be possible to automatically update a single file
1: First switch to the master branch:
git checkout master
2: Take out the file.ext file on the dev branch
git checkout dev -- file.ext
3: Then submit file.ext to the master branch
git add file.ext
git commit -m 'update file.ext from dev'
The above is the whole process
phpcn_u15822017-05-02 09:25:24
If this submission only contains this one required file, then the colleague can just use master to pull origin dev
If there are multiple commits on origin, and the colleague’s master only needs one of them, then the colleague will first pull origin dev on dev, and then return to master to cherrypick the commit(s) needed on dev
If this target file is mixed in a certain submission (that is, there is more than one change in the submission, but the colleague’s master only needs this one file), then just like @brucemj said, manually checkout
阿神2017-05-02 09:25:24
There is a way. First push the content you want to update. Then switch the branch and then right-click replace width and select branch, tag, or reference to select the branch content you just submitted. It will be ok
This is the eclipse .git plug-in