Hi, Habr! Once again, a very interesting
repository caught my eye. This cheat sheet on the most secret and functional features of Git and GitHub appeared thanks to the speeches of Zack Holman,
one of the articles of which I translated Git and GitHub Secrets to Aloha Ruby Conference 2012 and
More Git and GitHub Secrets to WDCNZ 2013. It is worth saying that the project scored over 1000 olds in less than 12 hours. I will give a few examples:
Hub - Git Wrapper
Hub is a shell over Git, which reduces the time spent on unnecessary keystrokes when working with Git.
$ hub clone tiimgreen/toc > git clone https://github.com/tiimgreen/toc.git
On the
hub, you can make an alit
git and everything will look even more convenient:
Previous branch
To go to the previous directory we use:
$ cd -
Similarly, you can switch between branches in Git:
$ git checkout -
')
Closing Issues with Commitments
To do this, you must specify the Issue number in the commit and add the word single with fix / fixes / fixed or close / closes / closed:
$ git commit -m "Fix cock up, fixes #12"

Checking out Pull Requests
If you want to checkout for pull requests, you first need to pick it up:
$ git fetch origin '+refs/pull/*/head:refs/pull/*'
After that, it is necessary to checkout itself
$ git checkout refs/pull/42
View the history of a particular author’s commit
To do this, add the parameter
? Author = username to the URL:
https://github.com/rails/rails/commits/master?author=dhh
Stylized Git Log
$ git log --all --graph --decorate --oneline --abbrev-commit

Git query
Git Query allows you to find previous commits by message, where “query” is the search phrase:
$ git show :/query
And a whole lot of different secrets on
github-cheet-sheet .
Thank you all for your attention.