Skip to content

Instantly share code, notes, and snippets.

@Dru89
Created September 4, 2013 06:49
Show Gist options
  • Save Dru89/6433491 to your computer and use it in GitHub Desktop.
Save Dru89/6433491 to your computer and use it in GitHub Desktop.
ORIGIN_GIT_REPO=/path/to/my/origin/repo.git
###############################
# Method 1: You don't care if the clone is a repo, you just want the files
# (useful for builds/etc that you aren't manually working with)
TMP_GIT_CLONE=/path/to/local/clone
git clone $GIT_REPO $TMP_GIT_CLONE
# if you do some build logic, it could go here like:
# cd $TMP_GIT_CLONE/
# make
# make install
# rm -rf $TMP_GIT_CLONE
exit
###############################
# Method 2: You actually use the clone like a repo.
# (useful for just syncing up another workspace)
PATH_TO_OTHER_REPO=/path/to/local/other
cd $PATH_TO_OTHER_REPO
git pull --rebase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment