How to stop the merge (again ....)
How can I permanently stop Git from trying to merge? I never want it to merge.
From How do I make Git honor a canceled merge that was not asked for? I know the tool doesn't respect my undo by killing the editor it spins without asking me. So now I'm just a kill -9
terminal process.
If I get into a situation where Git wants to merge, I always need a copy of the original file. I'll just delete the file locally and then fetch it from the server again.
Right now Git is doing DoS'ing me with this fraction:
You have not completed your merge (MERGE_HEAD exists).
Please make your changes before you can merge.
Of course it git reset HEAD <file>
didn't work.
And here's the best part: it's tag accurate . There are no differences . I make changes, I test them on 8-12 different platforms (copying from scp
) and then test it on one of these fields after testing. But from Tell Git to stop requesting conflicts when no one exists? I know the tool is too stupid to show any intelligence in this area.
In case you're wondering, there is one set of sources. These are project sources located on a remote server. All I want to do Git is checkout (clone), update (pull), tell me what has changed (diff) and checkin (push). I don't need any other functionality from the tool.
source to share
You can declare a custom merge driver for ' *
' (all files) in .gitattributes
, with keepTheir
script.
echo * merge=keepTheir > dirWithCopyMerge\.gitattributes
git config merge.keepTheir.name "always keep theirduring merge"
git config merge.keepTheir.driver "keepTheir.sh %O %A %B"
keepTheir.sh
will be:
mv -f $3 $2
exit 0
I need to get a copy of the file on the server (and possibly modify it). In Subversion I would use svn update
Simple: use git fetch
(which won't trigger any merge) and then git checkout
:
git checkout origin/master -- path/to/file
(see " git: how to update (check) a single file from a remote original source ")
source to share