Skip to content

Instantly share code, notes, and snippets.

@kelp404
Last active December 12, 2015 01:19
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 kelp404/4690522 to your computer and use it in GitHub Desktop.
Save kelp404/4690522 to your computer and use it in GitHub Desktop.
Git note

#Git note

Tags

git tag -a <tag name> -m <comment>
git tag -d <tag name>

Push tags to remote

git push origin --tags

Delete remote tag

git tag -d 1.0
git push origin :refs/tags/1.0

Syncing a fork

# Add the remote, call it "upstream":

git remote add upstream git://github.com/whoever/whatever.git

# Fetch all the branches of that remote into remote-tracking branches,
# such as upstream/master:

git fetch upstream

# Make sure that you're on your master branch:

git checkout master

# Rewrite your master branch so that any commits of yours that
# aren't already in upstream/master are replayed on top of that
# other branch:

git rebase upstream/master

https://help.github.com/articles/syncing-a-fork


pull submodules

git submodule foreach git pull origin master
git submodule foreach --recursive 'git fetch --tags'

remove a commit on github

git push -f origin HEAD^:master

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