Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 67 lines (45 sloc) 1.95 KB
#bash script (by eq8) for getting this functionality:
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root (use sudo !)" 1>&2
exit 1
echo "===========================================================
This directrory will act as svn
that means, when git conflict accure between 2 branches,
changes in your branch will owerite version you are merging
if [ ! -f /usr/bin/ ]; then
echo "creating /usr/bin/"
touch /usr/bin/
chmod a+x /usr/bin/
echo "# I want to keep MY version when there is a conflict
# Nothing to do: %A (the second parameter) already contains my version
# Just indicate the merge has been successfully "resolved" with the exit status
#uncoment next line if you wan't to keep their changes when git conflict
#cp -f \$3 \$2
exit 0" > /usr/bin/
function is_a_git_repositary {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
if [ -z $(is_a_git_repositary) ]; then
echo "Error: not a git repository!
try git init + git commit -a
echo '* merge=keepMine' > .gitattributes
git config "always keep mine during merge"
git config merge.keepMine.driver " %O %A %B"
#if you want only merge functionality coment next 3 lines
echo '* rebase=keepMine' >> .gitattributes
git config "always keep mine during rebase"
git config rebase.keepMine.driver " %O %A %B"
#if you dont want to ignore pull conflicts coment next 3 lines
echo '* pull=keepMine' >> .gitattributes
git config "always keep mine during pull"
git config pull.keepMine.driver " %O %A %B"
echo 'done'
Something went wrong with that request. Please try again.