Skip to content

Instantly share code, notes, and snippets.

@dkirrane
Last active December 28, 2015 21:29
Show Gist options
  • Save dkirrane/7565273 to your computer and use it in GitHub Desktop.
Save dkirrane/7565273 to your computer and use it in GitHub Desktop.
#!/bin/sh
##
# Run this from GitBash
##
mvn archetype:generate -B -DarchetypeGroupId=org.codehaus.mojo.archetypes -DarchetypeArtifactId=pom-root -DarchetypeVersion=1.1 -DgroupId=com.mycompany -DartifactId=Bug238423
cd Bug238423
git init
git add -A
git commit -m "Initial project"
git checkout -b myBranch
sed -i 's/1.0-SNAPSHOT/1.1-SNAPSHOT/g' pom.xml
git commit -a -m "myBranch commit"
git commit --allow-empty -m "Some other commit"
touch someFile.txt
echo hello world >> someFile.txt
git add -A
git commit -m "Commiting someFile"
git checkout master
sed -i 's/1.0-SNAPSHOT/1.2-SNAPSHOT/g' pom.xml
git commit -a -m "master commit"
git merge myBranch
##
# List files with merge conflicts
##
echo "Merge Conflicts:"
git diff --name-only --diff-filter=U
##
# Once you get the merge conflict message from above open the pom.xml file in NetBeans
# Then run the following from Git Bash
# git checkout --theirs pom.xml
##
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment