
A few of my Git tricks, tips and workflows - fogus
http://nuclearsquid.com/writings/git-tricks-tips-workflows.html
======
Zev
The best thing I did to help me get into using git was set up some aliases, to
make it at least _pretend_ it was like Mercurial and only needed the bare
minimum number of characters to complete a command (in ~/.gitconfig):

    
    
      [alias]
      	st = status
      	d = diff
      	ci = commit
      	sh = stash
      	co = checkout
      	ps = push
      	pl = pull
      	cp = cherry-pick

~~~
chalst
I'd find cp much too unintuitive as an abbreviation for cherry-pick to use;
less so but likewise with sh for stash.

I like the aliases at <http://ruderich.org/simon/config/gitconfig> though I'd
call "fsck --strict --full" fsf.

There was an SO qn: [http://stackoverflow.com/questions/267761/what-does-your-
git...](http://stackoverflow.com/questions/267761/what-does-your-gitconfig-
contain)

~~~
Zev
`cp` for `cherry-pick` fits how I think about git and cherry-picking -- I'm
copying a patch from one branch into another, aren't I?

~~~
chalst
Maybe "cpc" for "copy cherry" then?

------
cpeterso
My favorite Git tip is easygit (eg). It's training wheels wrapper for git. You
use real git commands, but easygit has safer defaults and extra sanity checks
(like forgetting to stage modified files). The help messages are more verbose
and use more consistent terminology than git's man pages. For example, easygit
always uses the term "staged" instead of
"index/staged/add/hard/soft/mixed/cached/HEAD/etc."

<http://people.gnome.org/~newren/eg/>

------
chapel
I like the simplicity of this blog, not to mention the quality of this guide.
I will definitely be taking a look at including some of these into my
workflow. Thanks for this.

------
nazri1
I wrote a tool, git-number[1], that allows me to use numbers when specifying
file or directory names to any git operation.

I never have to resort to tab-completion ever since.

[1] <https://github.com/holygeek/git-number>

~~~
bostonvaulter2
Looks pretty interesting. I usually use git add --interactive to accomplish
most of this. Or just use tmux to copy the whole filename.

------
pilif
Very comprehensive article. While some of the stuff is well known by now, I'm
sure there's something new in there for anybody. Very good find, OP

------
graywh
Why is the solution for Git completion in Zsh to just load the Bash
completion? There is _native_ Zsh completion for Git.

~~~
cypher23
Thanks, I've updated the post to include this info.

~~~
graywh
I'll add that you can download the git completion functions if needed from
[http://zsh.cvs.sourceforge.net/viewvc/*checkout*/zsh/zsh/Com...](http://zsh.cvs.sourceforge.net/viewvc/*checkout*/zsh/zsh/Completion/Unix/Command/_git)

------
cas
Related discussion for git workflow/branching

<http://news.ycombinator.com/item?id=1826279>

------
morbidkk
for windows folks smartgit is really good client. Am using old version where
all features were free and not restricted to 30 day period.

------
s1rech
very solid, although I'd like to see some hook scripts to get some ideas of
what can be done there

~~~
cypher23
I've got a few hook scripts in my dotfiles here:
<https://github.com/cypher/dotfiles/tree/master/git-hooks>

But you can also take a look at the `.git/hooks/` directory in any git repo,
it includes a lot of sample hooks.

~~~
s1rech
thanks for the tip!

