dotfiles/docs/Git.md

91 lines
2.1 KiB
Markdown
Raw Normal View History

2012-12-06 20:56:02 +00:00
# Git Awesomeness
2012-12-06 21:02:21 +00:00
## Aliases
2012-12-06 20:56:02 +00:00
### Shorthands
2012-12-06 21:02:21 +00:00
* **git a** → git add
* **git ua** → git reset HEAD
* **git b** → git branch
* **git c** → git commit
* **git ca** → git commit -a
* **git cm** → git commit -m
* **git cam** → git commit -am
* **git co** → git checkout
* **git d** → git diff --color-words
* **git s** → git status -sb
### git l
2012-12-06 20:56:02 +00:00
Simple one-line-per-commit log.
2012-12-06 21:02:21 +00:00
### git ll
2012-12-06 20:56:02 +00:00
Log with list of changed files for each commit.
### git-append
2012-12-06 20:56:02 +00:00
Add all staged files to previous commit.
### git-conflicts
2012-12-13 12:27:12 +00:00
List of files with unresolved conflicts.
### git-root (or gr)
2012-12-06 20:56:02 +00:00
Jump to root folder of Git repo.
### git-github [repo]
Setup syncronization of current Git repo with GitHub repo of the same name
### git-bitbucket [repo]
Setup syncronization of current Git repo with Bitbucket repo of the same name
### git-fork <original-author>
Add remote upstream.
### git-upstream [branch]
Sync branch (`master` by default) with upstream.
2012-12-06 20:56:02 +00:00
## [git-friendly](https://github.com/jamiew/git-friendly)
### pull
Stash any local changes, pull from remote using rebase, updates submodules, pop your stash, then run `bundle install` and/or `npm install` if necessary.
### push
Push your changes to the remote + copy a sexy diff URL like http://github.com/jamiew/git-friendly/compare/e96033…5daed4 to your clipboard (works on Mac and Linux).
### branch [name]
Switch branches or create new local branch if it doesnt exist. Intelligently sets up remote branch tracking so you can just type `git pull` and not always `git pull origin newbranch`. If no argument specified will list all local and remote branches.
### merge [name]
Merge the specified branch into the current branch. Rebases first if the branch is local-only.
## [git-extras](https://github.com/visionmedia/git-extras)
See `git extras --help` or [documentation](https://github.com/visionmedia/git-extras/blob/master/Readme.md) for all available commands.
## [hub](https://github.com/defunkt/hub)
See `hub help` or [documentation](http://defunkt.io/hub/hub.1.html) for all available commands.