Skip to content

Instantly share code, notes, and snippets.

@jvwong
Last active April 6, 2016 15:14
Show Gist options
  • Save jvwong/efe036f0b7a1c5627ce668ddfdbb294a to your computer and use it in GitHub Desktop.
Save jvwong/efe036f0b7a1c5627ce668ddfdbb294a to your computer and use it in GitHub Desktop.
Tracking a gist in repo

You can add the github repository as a remote to your checked out gist repository.

$ git clone git://gist.github.com/1234.git
$ git remote add github git@github.com:ChrisJamesC/myNewProject.git

Push it to initialize the git on github

$ git push -u github master

This will also change the upstream of the branch, so github will be default.

You now can rename the remote of gist:

$ git remote rename origin gist

Each time you make changes (or pull changes from github/gist), you can do:

$ git push                 # To github
$ git push gist master     # To gist

This will also push back your changes to the gist and not only the github repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment