git log

  • -p, which shows the difference introduced in each commit.
  • --stat, abbreviated stats for each commit
  • --pretty=<option>, This option changes the log output to formats other than the default.
    • <option>: oneline, short, full, and fuller
  • --pretty=format:"%h - %an, %ar : %s", allows you to specify your own log output format.
  • --graph, adds a nice little ASCII graph, good to used with oneline and format
  • -(n), Show only the last n commits
  • --since, --after, Limit the commits to those made after the specified date.
  • --until, --before, Limit the commits to those made before the specified date.
  • --author, Only show commits in which the author entry matches the specified string.
  • --committer, Only show commits in which the committer entry matches the specified string.
  • --grep, Only show commits with a commit message containing the string
  • -S, Only show commits adding or removing code matching the string

git branch

  • -vv, see what tracking branches you have set up, will list out your local branches with more information including what each branch is tracking and if your local branch is ahead, behind or both.

git push

  • <remote> <local_branch_name>:<remote_branch_name>

git checkout

  • -b [branch] [remotename]/[branch],

git rebase

Rule of thumbs: Do not rebase commits that exist outside your repository.

results matching ""

    No results matching ""