Skip to content

Instantly share code, notes, and snippets.

@wch
Created December 11, 2011 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wch/1461760 to your computer and use it in GitHub Desktop.
Save wch/1461760 to your computer and use it in GitHub Desktop.
Load and test branches from another person's repository
# ====== Do this once =======
# Add the remote git repository (this needs to be done once):
git remote add wch https://github.com/wch/ggplot2.git
git fetch wch
# Install devtools (this needs to be done once):
install.packages("devtools")
# ====== Do this each time you want to try the code =======
# Check out the desired branch:
git checkout wch/feature/wdotplot
# It'll say something about detached HEAD state. This is OK.
# Load the library in R, without installing:
library(devtools)
load_all("/path/to/ggplot2/")
[test things out]
# ====== Other misc stuff =======
# To get your git repository back to the main branch:
git checkout master
# To get new changes from the repository:
git fetch wch
# You can remove the remote repository from your list by doing
git remote rm wch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment