管理git中的本地更改我从不想提交 [英] Managing local changes in git I never want to commit
问题描述
但是我确实希望保持打开状态以便更新其他人的更改。
目前我必须在每次更新工作空间时进行堆栈保存
必须有办法做到这一点,请问这是什么?
编辑
我仍然希望在执行git pull时反映其他人的更改,因此我不能简单地忽略这些文件。
编辑2
我是一个承包商,无法开始告诉他们改变他们组织他们的git回购的方式。我已明确更改的文件是gruntfile.js一个构建文件。
可以说你的数据库密码必须位于 myConfig.yml
中,但你永远不想将密码推送到版本控制系统。但是您需要本地来让您的应用程序正常工作。
所以,诀窍是每个人都会忽略 myConfig.yml
.gitignore
文件应该包含一行说 /config/myConfig.yml
但是如果有人添加了一个新参数,他必须添加它 myConfig.yml.dist
文件。他会承诺并推动它。因为每个人都需要了解它。但是,您只需在 myConfig.yml.dist
中使用虚拟数据和/或注释。所以基本上你可以复制 myConfig.yml.dist
到 myConfig.yml
添加正确的密码并运行应用程序。 / p>
So I have versions of files i have changed, these are very personal changes (for example turning minification off for a javascript build) That I am never going to commit. But I do want to leave it open for updating with other peoples changes.
Currently I have to do a stack save every time I update my workspace which is getting very annoying.
There must be a way to do this, please what is it?
EDIT
I still want other peoples changes to be reflected when i do a git pull, so I can't simply ignore these files.
EDIT 2 I am a contractor and can't start telling them to change the way they organise their git repo. The file I have explicitly change is gruntfile.js a build file.
Say you have the config file named myConfig.yml.dist
(dist for distribution) where all and everyone makes changes and pushes them to version control system.
But then lets say you have the databases password which has to be in the myConfig.yml
but you never want to push the password to a version control system. But you need it locally to have your application work. Also your local database password might not be the same as the one running live.
So the trick is that everyone ignores the myConfig.yml
so your .gitignore
file should contain one line saying
/config/myConfig.yml
But if someone adds a new parameter he has to add it in the myConfig.yml.dist
file. And he will commit and push it. Cause everyone need to know about it. But you kind of just have keys with dummy data and or comments in myConfig.yml.dist
. So basically you can copy myConfig.yml.dist
to myConfig.yml
add the right passwords and your application runs.
这篇关于管理git中的本地更改我从不想提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!