Skip to content

Instantly share code, notes, and snippets.

@rostegg
Created September 24, 2019 15:53
Show Gist options
  • Save rostegg/04c2642e2c4cbb06557f460d24321fbc to your computer and use it in GitHub Desktop.
Save rostegg/04c2642e2c4cbb06557f460d24321fbc to your computer and use it in GitHub Desktop.
Pull from remote repository with allowed unrelated history
#!/bin/bash
# Copy to /usr/bin and don't forget to make the script executable
# Usage: pull-unrelated <url> (or origin if not specified)
REPO_URL=$1
if [ -z "$REPO_URL" ]
then
REPO_URL="origin"
fi
git pull ${REPO_URL} master --allow-unrelated-histories
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment