What is the result when merging a branch with deleted files on git?
仅有的幸福
仅有的幸福 2017-05-02 09:46:18
0
2
699

Operation

1. For example, there are two branches: dev and myBranch. The content on the two branches is now the same and has been synchronized.

2. Now several files a.txt, b.txt have been deleted on dev; switch to dev locally for pull

3. Then switch to the myBranch branch and merge the dev content into myBranch

Question:

1. Are the files on myBranch deleted after the merge?

2. If the myBranch branch is merged into dev, will it be retained?

Since the company’s git cannot be operated casually, I hope someone who knows can help answer it

仅有的幸福
仅有的幸福

reply all(2)
黄舟
  1. git checkout myBranch; git merge dev. The result is that the file is deleted in myBranch.

  2. git checkout dev; git merge myBranch. Because the file has been deleted in dev, merging myBranch will not restore the file.

  3. You can’t play casually with the company’s git, so register a github yourself and play casually.

大家讲道理

The files after the merge will be saved. You always have a branch with a.txt and b.txt, so they will not be deleted

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template