git version 1.7.11.7
Fedora 17
Hello,
I create a new git working resposity
git init
I added some files and some directories.
However, I have some files that I want to ignore based on my environment. I don't want to create a .gitignore
file as I don't want it added to repository. Just my local.
So I want to ignore my server/build
directory so I added it to my .git/info/exclude
file.
# exclude patterns (uncomment them if you want to use them):
*.[oa]
*~
server/build
server is the root directory where I init my git resposity.
However, when I do git status I always get this directory in my untacked files.
# On branch dev
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
server/build/
I want to remove this from my git status.
I have tried the following with didn't work for me
git rm -r --cached server/build
Repository exclude - For local files that do not need to be shared, you just add the file pattern or directory to the file . git/info/exclude .
Open the . git/info/exclude file in a text editor and add the folder to ignore. This file remains private to you.
git/info/exclude . This file is your own gitignore inside your local git folder, which means is not going to be committed or shared with anyone else. You can basically edit this file and stop tracking any (untracked) file.
You're leaving a blankspace before the pattern. Delete it and it should work:
# exclude patterns (uncomment them if you want to use them):
*.[oa]
*~
server/build
If your repo doesn't have a .gitignore
you could create one and ignore itself, too - but it really is more correct to use exclude
, anyway.
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