Posts

Showing posts from February 8, 2011

Git crib sheet

Been using Git lately.  Much goodness to be had, but some commands are a little unfamiliar if coming from Subversion. So, here's my crib sheet of handy Git recipes I think will be useful. Configure your Git bash-3.2$ git config --global  user.name  "CustardCat" bash-3.2$ git config --global user.email " custard@cpan.org " bash-3.2$ git config --global -l user.name =CustardCat user.email= custard@cpan.org Create a new project and commit your code... # Create a project and cd into it.. cd my_project # Make the project a git project git init # Add all the files in the project to git git add . # Commit your local files git commit Get status, logs & diffs # Status of changes git status # Diffs git diffs # Add more files git add file1 file2 etc.. # See what's been happening git log git log --stat --summary git log --pretty=oneline # See diffs between versions. nb. only need first few chars of version git diff 16f8..8bd2 g...