0

I have added the file extension .patch to my .gitignore_global, however this hasn't updated in my local repo yet. I want to remove this from the untracked list but keep the file in my local repo.

git status:

Kierans-MacBook-Pro:master-abc kpmacbook$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
  (use "git add <file>..." to include in what will be committed)

    0001-adding-column.patch

nothing added to commit but untracked files present (use "git add" to track)

When I try to run this command: git rm --cached 0001-adding-column.patch

I get this:

Kierans-MacBook-Pro:master-abc kpmacbook$ git rm --cached 0001-adding-column.patch 
fatal: pathspec '0001-adding-column.patch' did not match any files
Kierans-MacBook-Pro:master-abc kpmacbook$

EDIT More info:

Kierans-MacBook-Pro:master-abc kpmacbook$ git config --get core.excludesfile
~/.gitignore_global

.gitignore_global file:

Kierans-MacBook-Pro:master-abc kpmacbook$ cat ~/.gitignore_global
# Logs and databases #
######################
*.log
*.sql
*.sqlite

# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# codekit #
###########
.sass-cache/
.codekit-config.json
config.codekit

# git #
.patch

How do I fix?

ifusion
  • 2,163
  • 6
  • 24
  • 44
  • "this hasn't updated in my local repo yet." This does not make sense - any config changes in git apply *immediately* (that as, the next time you run git). Something else must be wrong. – sleske Jul 22 '15 at 09:57
  • This might be helpful: http://stackoverflow.com/questions/7335420/global-git-ignore – Petr Skocik Jul 22 '15 at 09:59
  • @sleske, I have added more info to my post to show you my git ignore file etc – ifusion Jul 22 '15 at 10:05
  • @ifusion: Thanks, that makes it clearer. The error is in your ignore entry, as you already noted (missing asterisk). – sleske Jul 22 '15 at 11:03

1 Answers1

0

Solution:

Well all I needed to do was add an asterisk in front of the .patch file in my .gitglobal_ignore file...

e.g

# git #
---------------------
*.patch
ifusion
  • 2,163
  • 6
  • 24
  • 44