Skip to content

Commit

Permalink
.gitconfig: comment on the aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
janmoesen committed Oct 21, 2011
1 parent 1acec67 commit 2237934
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,26 @@
concise = %C(yellow)%h%C(reset) %s %C(bold black)(%an, %ar)%C(reset)%C(bold blue)%d%C(reset)

[alias]
# When doing "git git log" or some such, do not complain about "git" not
# being a valid Git command. This happens when copy-pasting examples, for
# instance.
git = !git

# Quickly view the latest commits in a multicolour oneliner format that
# highlights the parts I care about most: SHA, description and branch.
l = log --pretty=concise -n 20

# Like "git l", but show all and draw the history graph, too.
ll = log --pretty=concise --graph

# Show a concise status of the working directory, along with the branch
# and the number of commits behind and/or ahead.
s = status --short --branch

# Quickly push to the most common destination.
pom = push origin master

This comment has been minimized.

Copy link
@mathiasbynens

mathiasbynens Oct 22, 2011

Once the master branch is set up on the remote repository, you can just use git push instead of git push origin master since master is the implied default value, right?

This comment has been minimized.

Copy link
@janmoesen

janmoesen Oct 22, 2011

Author Owner

I used to think so, but then either the default behaviour changed or (more likely) I started using more branches. When doing git push without further arguments, it tries to push all known branches. This often results in unexpected rejections: where I thought only master would get pushed, Git tried to push other branches, too, but was unable to because they had already been changed on the remote side:

$ git push
To example:src
 ! [rejected]        example-module -> example-module (non-fast-forward)
 ! [rejected]        fix-foobar-widget -> fix-foobar-widget (non-fast-forward)
 ! [rejected]        subnav_hack -> subnav_hack (non-fast-forward)
 ! [rejected]        threepointo -> threepointo (non-fast-forward)
error: failed to push some refs to 'example:src'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again.  See the
'Note about fast-forwards' section of 'git push --help' for details.

# I know "pum" could just as well stand for "PUsh" instead of "PUll", but
# I am so used to "git pom" that "git pum" feels like a natural
# counterpart.
pum = pull origin master
git = !git

0 comments on commit 2237934

Please sign in to comment.