1
It's very hard to search for on Google with the amount of documentation there is about git, but basically, when I do a "git commit", it creates a file called "-". It has nothing in it, and is owned by my user. Is there a reason this file is being created and is there anything I can do to stop it since it's a little annoying? The file is not under git control. Git acts like its not even there.
UPDATE
As I'm answering questions in the comments, I realized that this happened right after I tried to make it so that I no longer needed to use "ssh-add" every time I wanted to push to a remote. The following is in my .bash_profile.
git() {
if ! ssh-add -l >/dev/null 2>-; then
ssh-add ~/.ssh/remote1
ssh-add ~/.ssh/remote2
fi
/usr/bin/git "$@"
}
export -f git
If this looks incorrect, let me know.
1Do you just type "
git commit
"? (no parameter at all?) – VonC – 2012-05-24T07:38:29.623At first I was doing "git commit -a", stopped doing that, so yes. All I'm doing is "git commit". – tubaguy50035 – 2012-05-24T08:35:37.577
1
Could you try a
– VonC – 2012-05-24T09:24:17.223git add -A
(see http://stackoverflow.com/questions/572549/difference-of-git-add-a-and-git-add), followed by agit commit -m "test"
and see if that file '-
' is still created?I removed the file "-" before I began. I ran "git add -A", I then ran "git commit -m "test". Git informed me of my branch, commit number, and message. It took a very long time, I ended it with "control-c". "Ls"-ed the directory, the magical "-" file had returned. – tubaguy50035 – 2012-05-24T16:01:57.117
1Curious! Can you recreate this behavior from a new repo? – invert – 2012-05-25T11:14:44.107
Yes. Upon any commit my user makes a file called "-" is created. If I make a commit as sudo, no file is created. See my updated question for more details. – tubaguy50035 – 2012-05-26T09:23:06.070