(ie mark it as deleted for git and stop tracking it) git rm --cached MyFile.txt # Remove file from index and from disk git rm MyFile.txt # Mistake? Undo? Careful now. git reset --hard HEAD
stash save "Changes in documentation" # List, show or clear stashes git stash list git stash show stash@{0} git stash clear # Use your stash git stash branch "DifferentBranch" git stash pop # ^^ (git stash apply && git stash drop)
git rebase -i HEAD~3 pick 5afdd30 more files reword ed8ad23 More jizzy files pick 8e6b89d trying some fix fixup fa167e2 maybe this works??? # Rebase 35f4454..fbc34fb onto 35f4454 (4 command(s)) # # Commands: # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash = use commit, but meld into previous commit # f, fixup = like "squash", but discard this commit's log message # x, exec = run command (the rest of the line) using shell # d, drop = remove commit
tag name" # Delete a tag git tag -d 0.0.1 # Push a tag git push origin master --tags # Delete tag from remote (GitHub) git push origin :refs/tags/0.0.1 Always respect SEMVER .
available. Some (Xcode, Android Studio…) even miss basic features. In case some error happens, you get a weird non descriptive message and you’re not sure which command was actually executed.
hub: pull-request Open a pull request on GitHub fork Make a fork of a remote repository on GitHub and add as remote create Create this repository on GitHub and add GitHub as origin browse Open a GitHub page in the default browser compare Open a compare page on GitHub release List or create releases (beta) issue List or create issues (beta) ci-status Show the CI status of a commit brew install hub