Skip to content

Instantly share code, notes, and snippets.

@loncarales
Created May 26, 2020 21:29
Show Gist options
  • Save loncarales/6e8f004e2d7f44144edf81134944a3bd to your computer and use it in GitHub Desktop.
Save loncarales/6e8f004e2d7f44144edf81134944a3bd to your computer and use it in GitHub Desktop.
Git: Creating a merge conflict
#!/bin/bash
mkdir git-merge-test
cd git-merge-test
git init
touch merge.txt
git add merge.txt
echo "this is some content to mess with" > merge.txt
git commit -am 'we are commiting the inital content'
git checkout -b new_branch_to_merge_later
echo "totally different content to merge later" > merge.txt
git commit -am 'edited the content of merge.txt to cause a conflict'
git checkout master
echo "content to append" >> merge.txt
git commit -am"appended content to merge.txt"
git merge new_branch_to_merge_later
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment