Using multiple remote repositories with Git | David Murphy

Something I am using for some of my projects:

Using multiple remote repositories with Git | David Murphy.

Still most of the time I prefer to use a private GitLab repo until I decide I can show the modifications to the world on GitHub.

Ignoring files · GitHub Help

Sometimes I need to have a different app configuration when running the same app under different environments.

The best way for me while working both with a local Vagrant configuration and a custom configured production environments is to use:

git update-index --assume-unchanged path/to/file.txt

The full information can be found here: Ignoring files · GitHub Help.

Don’t put the config files in .gitignore, just change them locally and update-index. If there is a newer version of the file coming from the remote repo, you will be notified and will not miss update.