I'm working on a project with 4 member of team, everyone have different files config, and we're already using git update-index --assume-unchanged to/the/file
but the newcomer hasn't noticed to use update-index to the config files and accidentally pushed the file to the repo as in:
application/config/database.php
And we're working with branches, while we're pulling the file on master it got no warning/something. But the database config file has been changed, and everytime we tried to change branches, this following files always needed to checked out before we change branch.
Is it any method we could ignore this file as if anyone has been changed it? So it wouldn't prompt us to checking it out before we change branch.
Thank you in advance.
Let's say you have already added/committed some files to your Git repository and you then add them to your . gitignore file; these files will still be present in your repository index.
Set “–assume-unchanged” to a path to exclude to check on git commit and it will exclude your file from git commit. You will need to use the git update-index and –assume-unchanged to exclude files from git commit.
In the Git Changes window, right-click any changed file that you want Git to ignore and choose Ignore this local item or Ignore this extension.
git rm --cached file
.gitignore
file on root folder of your repo. This will protect you fron new user to commit the file.gitignore
fileDocumentation : gitignore
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