5 ms·
A few of my Git tricks, tips and workflows
- chapel 16y agoI 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.
- cas 16y agoRelated discussion for git workflow/branching http://news.ycombinator.com/item?id=1826279 http://news.ycombinator.com/item?id=1826279
- cpeterso 16y agoMy 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/ http://people.gnome.org/~newren/eg/
- pilif 16y agoVery 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
- Zev 16y agoThe 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 16y agoI'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 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-gitconfig-contain http://stackoverflow.com/questions/267761/what-does-your-git...
- brown9-2 16y agogit-sh is a pretty cool script for this sort of thing (although not aimed at similarity to mercurial): https://github.com/rtomayko/git-sh https://github.com/rtomayko/git-sh
- morbidkk 16y agofor windows folks smartgit is really good client. Am using old version where all features were free and not restricted to 30 day period.
- nazri1 16y agoI 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 https://github.com/holygeek/git-number
- bostonvaulter2 16y agoLooks pretty interesting. I usually use git add --interactive to accomplish most of this. Or just use tmux to copy the whole filename.
- graywh 16y agoWhy is the solution for Git completion in Zsh to just load the Bash completion? There is native Zsh completion for Git.
- cypher23 16y agoThanks, I've updated the post to include this info.
- graywh 16y agoI'll add that you can download the git completion functions if needed from http://zsh.cvs.sourceforge.net/viewvc/*checkout*/zsh/zsh/Completion/Unix/Command/_git http://zsh.cvs.sourceforge.net/viewvc/*checkout*/zsh/zsh/Com...
- s1rech 16y agovery solid, although I'd like to see some hook scripts to get some ideas of what can be done there
- cypher23 16y agoI've got a few hook scripts in my dotfiles here: https://github.com/cypher/dotfiles/tree/master/git-hooks 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 16y agothanks for the tip!