Skip to content

Instantly share code, notes, and snippets.

@lucasw
Last active May 3, 2019 04:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucasw/f73803773fec7db45575bcd241a5381a to your computer and use it in GitHub Desktop.
Save lucasw/f73803773fec7db45575bcd241a5381a to your computer and use it in GitHub Desktop.
github cheatsheet

Update fork to upstream

https://gist.github.com/CristinaSolana/1885435

git remote add upstream git://github.com/ros-visualization/qt_gui_core.git
git fetch upstream
git pull upstream kinetic-devel
git push

Now the github page say "This branch is even with ros-visualization:kinetic-devel.", at least until more commits are made, then the fetch pull push needs to be repeated.

Does the remote add need to be done for every new clone of the same repo?

Make a feature branch

git checkout -b unknown_plugin_perspective
Switched to a new branch 'unknown_plugin_perspective'
git push
fatal: The current branch unknown_plugin_perspective has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin unknown_plugin_perspective
git push --set-upstream origin unknown_plugin_perspective

Now the branch appears under branches pulldown on github page.

@lucasw
Copy link
Author

lucasw commented Mar 3, 2018

Checkout an upstream branch

git checkout -b kinetic-devel remotes/upstream/kinetic-devel
git push --set-upstream origin kinetic-devel

@lucasw
Copy link
Author

lucasw commented May 28, 2018

Need to re-import and preserve all commit history, bring over commit from https://github.com/lucasw/gephex

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