Skip to content

Instantly share code, notes, and snippets.

@michael-martinez
Last active March 10, 2021 15:29
Show Gist options
  • Save michael-martinez/9706adcd8311819228d82dfd1698c65f to your computer and use it in GitHub Desktop.
Save michael-martinez/9706adcd8311819228d82dfd1698c65f to your computer and use it in GitHub Desktop.
gitCheatsheet
To pull before push without merging:
git reset --soft HEAD~ && git stash && git pull && git stash pop
Troubleshoot pbxproj file (Optional):
sed -i '' '/<<<<</d' *.xcodeproj/project.pbxproj
sed -i '' '/=====/d' *.xcodeproj/project.pbxproj
sed -i '' '/>>>>>/d' *.xcodeproj/project.pbxproj
To pick granular setup commits:
git cherry-pick <hash>
To setup CI tool:
git checkout -b setup-travis && touch .travis.yml && git commit -m "Setup .travis.yml" && git push
vi .travis.yml && git commit -m "Fix Setup .travis.yml" && git push
git checkout master && git merge setup-travis
Rebasing:
git fetch
git rebase -i origin/develop
git push --force-with-lease
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment