假設有 master 分支 和 dev 分支,檔案結構如下:master |--fileA |--fileB
dev |--fileA |--fileB
現在我只想將dev 下的 fileA 檔案合併到 master 下的 fileA檔案下,而,不想 將dev 下的 fileB 檔案合併到 master 下的 fileB檔案下,
也就是在合併時 忽略 兩個分支下的 fileB 檔案;請問我該怎麼做? 謝。
ringa_lee
使用.gitignore
先切換到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
git checkout master
git checkout dev -- fileA
git add fileA
git commit -m "xxx"
git push [repo] master
使用.gitignore
先切換到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