I'm not sure if what I'm looking for is a git-stash
but here is what I want to do.
I have configuration files customized for local use. Those files already exist in Git. Now, if I add a new feature (change other files), I want to stash my config and hit commit and only commit the files related to my new feature.
If I use git-stash, it stashes everything. How can I stash my config files (only)?
Thanks
Two things.
You should stage only the files you want to for the commit. This is done using git add
. Even if you have a ton of changes, you can stage only the fields (and pieces of files using git add -p
) you want to commit using git add. You should be doing this.
Unless your config file is an integral part of your application (and you want to version control it), you should be ignore
ing and not even version controlling it.
use git add -p
and select only those changes you want to commit. this is good practise anyway, because it acts as a little code review.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With