Interesting Reading on Git, GitHub

Tobias Megies edited this page Sep 14, 2018 · 12 revisions
Strictly speaking, you do not need another remote. To just download the code
use `git fetch upstream pull/1756/head:fix_arclink`. To push, you can specify
the remote url without adding it `git push fix_arclink`.

I also like to set an `insteadOf` config like:

$ git config --list | grep instead

so that I can do `git push github:petrr/obspy fix_arclink`.
  • convert existing issue into a pull request
    • can be done using github/hub (available for Anaconda)

      hub pull-request -i 1704 -b obspy:master -h obspy:trace_always_contiguous
    • or via a simple POST command, e.g. using curl:

      curl --user megies --request POST --data '{"issue": "2", "head": "megies:testbranch2", "base": "master"}'
      # in case of 2-factor authentication enabled..
      curl --header "X-GitHub-OTP: 123456" --user megies --request POST --data '{"issue": "2", "head": "megies:testbranch2", "base": "master"}'
      • issue: number of the already existing normal issue
      • head: repository/branch that should be pulled in
      • base: branch that the pull request should be merged into (target repository specified in the url), usually either master (for feature branches) or releases (for bug fixes)
  • interaction with svn
  • Squash commits using git rebase
# squash the last 4 commits interactively
# Only do this on a branch no one else is using
git rebase -i HEAD~4
git push --force upstream my_feature_branch
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.