Ignore specified files when git merges
ringa_lee
ringa_lee 2017-05-02 09:39:09
0
2
640

Assume there are master branch and dev branch,
The file structure is as follows:
master
|--fileA
|--fileB

dev
|--fileA
|--fileB

Now I just want to merge the fileA file under dev into the fileA file under master,
However, I don’t want to merge the fileB file under dev into the fileB file under master,

That is, when merging, ignore the fileB files under the two branches;
What should I do?
Thank you.

ringa_lee
ringa_lee

ringa_lee

reply all(2)
Peter_Zhu

Use .gitignore

伊谢尔伦

First switch to the master branch: git checkout master
然后把dev分支下的fileA“移”到本地:git checkout dev -- fileA
然后add,commit,push:git add fileA, git commit -m "xxx", git push [repo] master

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