Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.0k views
in Technique[技术] by (71.8m points)

GIT如果需要两个分支保持两个不同的文件夹,但是不提交该怎么办?

比如:GIT两个分支a分支和b分支,在a分支有个A文件,在.gitignore忽略了A文件后,切换到分支b,发现A文件出现在了b分支,

所以我需要在a分支保证A文件的存在,但是我又不想提交A文件,也不想它出现在b分支,有什么办法吗?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

搜索.gitattributes,该文件可以定义合并的策略


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...