I have forked a project on github and started messing around with it on my own machine, I want to commit the changes I have made back to my fork on github but without commiting the changes I have made to the .cfg file, since this contains things like db password etc
Git Ignore – How to Ignore Further Edits to a Single File Without Removing It
gitgithubgitignore
Best Answer
Use this:
And to restore:
Lastly, if you want to list files that are marked with
skip-worktree
:To simplify, you can make an alias for that in your
$HOME/.gitconfig
:Then you can type just
git ls-ignored-changes
. It even works with auto-completion if you have thegit-completion
in place (for bash, tcsh, zsh).