Saving local overwrites and reapplying them as modified after git pull

We use a configuration management repository for our big project. I have to change some of the general settings for some of my special work cases.

Therefore I have to modify some of the configuration files, but still want to be able to save these changes, when I update the project from remote (git pull). Ideally my changes should show as modified in git status

I did not find a question about this special work flow case so far. So whats the best approach?

  • Proper version control workflow for a mixture of repositories
  • Switching a team from Git Merge to Rebase
  • What is a good git workflow for TDD?
  • Git rebasing back/forth between two branches
  • How does Git's concept of the Index improve or change your workflow?
  • Git switch branch but keep modified files
  • How to synchronize two branches in the same Git repository?
  • development with git and php (web development)
  • 2 Solutions collect form web for “Saving local overwrites and reapplying them as modified after git pull”

    You can use git stash to store your working folder (uncommitted) changes.

    After the git pull, you can reapply those changes using git stash pop.

    wolfs answer is possibly the easiest and most convenient way. When you want to (remotely) backup your changes or keep different versions, here is another approach:

    Create a branch and then commit the modified version there.

    Then you apply the changes of that commit as modified to your current head via:

    git cherry-pick <commit-hash>
    git reset --mixed HEAD~1

    reset –mixed option: changed files are preserved but not marked for commit. It’s the default option.

    When you want to save a different personal modified version, create a new branch and proceed as above.

    Git Baby is a git and github fan, let's start git clone.