Search code examples
rubygithubgitignoregit-assume-unchanged

How do I ignore files when pulling from github?


I am working in Ruby and want to ignore my config files when I pull from Github.

The error I am receiving is: "error: Your local changes to the following files would be overwritten by merge: config/database.yml"

Things I have tried:

1) I added the file paths to my .gitignore located in my application root.

2) I added the file paths to my global .gitignore

3) I ran git update-index --assume-unchanged /config/database.yml from my application root

4) I ran git update-index --skip-worktree config/database.yml from my application root

I have multiple instances of the same application in several different folders on my computer. The other instances of the application respect the assume-unchanged command. Im not sure what I am missing.


Solution

  • Consider stashing your local changes before pulling:

    git stash
    git pull
    git stash pop
    

    It is possible that you have merge conflicts if the files you are stashing are changed on the origin.