4 ms·
My normal workflow with git is through the cli. Cli really is the best way to use it since git is good at prodding you along to do the right thing. Make sure
by matwood 13y ago
My normal workflow with git is through the cli. Cli really is the best way to use it since git is good at prodding you along to do the right thing. Make sure to go find a good set of aliases and turn on git prompt.
When I need to look at histories or large change sets I'll open up SourceTree or go to the BitBucket repos. If I need to see the file history of a single file gitk -p -- file is the quickest way that I have found.
I'm currently dealing with 2 projects that are similar and share code but are in different repos. Git has made it easy to add remotes to each project and cherry pick commits that need to be shared. As someone who started with VSS years ago, Git continues to amaze me with how easy it makes source wrangling.
- hrjet 13y agoWhat is "git prompt" and how do I turn it on? A quick search didn't reveal anything.
- riannucci 13y agoI think the parent is meaning something like the git-status integration of e.g. oh-my-zsh [0], or something like the 'official' git-status integration script for bash [1] (I've used the former, but not the latter.) [0] https://github.com/robbyrussell/oh-my-zsh https://github.com/robbyrussell/oh-my-zsh [1] https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh https://raw.github.com/git/git/master/contrib/completion/git...
- matwood 13y agoAdd this to wherever you setup your bash prompt: source /usr/local/git/contrib/completion/git-prompt.sh source /usr/local/git/contrib/completion/git-completion.bash GIT_PS1_SHOWDIRTYSTATE=true export PS1='\u@\h \[\033[01;34m\]\w\[\033[00m\]$(__git_ps1 "\[\033[01;33m\](%s)\[\033[00m\]")$ ' source ~/.profile What this does is add a git style prompt anytime you are in a directory managed by git. On the prompt it will show your current branch, what state it is in (+'s/*'s show if you have changes), if your are merging/rebasing/cherry-picking/etc... The source files may live in slightly different places on your machine depending on where you installed git. This above also adds tab completion for git commands, branches, tags, etc... Also, see my .gitconfig for aliases I have put together from various places on the net: https://github.com/matwood/cfg/blob/master/.gitconfig https://github.com/matwood/cfg/blob/master/.gitconfig