Take the 2-minute tour ×

When I do a git push, git will do forced updates automatically if necessary, as if I had specified the --force option. I have configured this a long time ago. I don't want this behavior anymore, and can't find what is the configuration variable that affects this behavior. I can't find anything relevant in the .gitconfig or .git/config files.

EDIT: added my current config files:

my .gitconfig:

    name = xxxx xxxx
    email = xxxx
    excludesfile = /Users/xxxx/.gitignore_global
[difftool "sourcetree"]
    path = 
[mergetool "sourcetree"]
    cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
    trustExitCode = true

local repo config:

    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
[remote "origin"]
    url = ssh://xxxx@xxxx.com/var/git/tw
[remote "AudioCopy"]
    url = /Users/xxxx/Src/AudioCopy/myacp
    fetch = +refs/heads/*:refs/remotes/AudioCopy/*
[submodule "Sources/iPhoneInterface/SoundCloud/CocoaSoundCloudAPI"]
    url = git://github.com/soundcloud/CocoaSoundCloudAPI.git
[submodule "Sources/iPhoneInterface/SoundCloud/CocoaSoundCloudUI"]
    url = git://github.com/soundcloud/CocoaSoundCloudUI.git
[submodule "Sources/iPhoneInterface/SoundCloud/JSONKit"]
    url = git://github.com/nxtbgthng/JSONKit.git
[submodule "Sources/iPhoneInterface/SoundCloud/OAuth2Client"]
    url = git://github.com/nxtbgthng/OAuth2Client.git
[submodule "Sources/iPhoneInterface/SoundCloud/OHAttributedLabel"]
    url = git://github.com/nxtbgthng/OHAttributedLabel.git
[branch "linux"]
    remote = origin
    merge = refs/heads/linux

remote repo config:

    repositoryformatversion = 0
    filemode = true
    bare = true

sample run:

~/Src/tw % git push
Counting objects: 7, done.
Delta compression using up to 8 threads.
Writing objects: 100% (3/3), 394 bytes, done.
To ssh://xxxx@xxxx.com/var/git/tw
   26636fd..4247b2e  guile20 -> guile20
 + e80b72f...3578ee1 linux -> linux (forced update)
~/Src/tw %
share|improve this question

1 Answer 1

up vote 3 down vote accepted

From your [remote "origin"] config entry it looks like you've set up a mirroring push. If this is not what you wanted I would get rid of this line entirely. If you are happy with a mirror style push but don't want to force (this doesn't make a lot of sense to me), you want to remove the + prefix from the push line in the [remote "origin"] section of your local repository's config.


git config --unset remote.origin.push


git config remote.origin.push 'refs/heads/*:refs/heads/*'

depending on which choice you make.

share|improve this answer
That was it. Thanks a lot. I will consider the different options. –  Thomas Jun 4 '12 at 13:35

Your Answer


