简体   繁体   English

Git:在本地和远程存储库中保留一个不同的目录吗?

[英]Git: keep a directory different in local and remote repository?

I want to make a directory different in my local and remote repository. 我想在本地和远程存储库中创建一个不同的目录。 If I add the directory to .gitignore, then the directory in remote repository will disappear when I push. 如果将目录添加到.gitignore,则在我推送时远程存储库中的目录将消失。

Have you tried adding the directory to .git/info/exclude file? 您是否尝试过将目录添加到.git/info/exclude文件? It holds local exclusions and should not affect anything on the remote side. 它包含本地排除项,并且不应影响远程端的任何内容。 (See http://help.github.com/articles/ignoring-files .) (请参阅http://help.github.com/articles/ignoring-files 。)

I think the .gitignore way is also correct unless you push your .gitignore file. 我认为.gitignore方式也是正确的,除非您推送.gitignore文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM