Nice display of the current tree
git log --graph --all --format=format:"%x09%C(yellow)%h%C(reset) %C(green)%ai%x08%x08%x08%x08%x08%x08%C(reset) %C(bold white)%cn%C(reset)%C(green)%d%C(reset)%n%x09%C(white)%s%C(reset)" --abbrev-commit "[email protected]"
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
You can also make an alias. Copy and paste the line below on your terminal:
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
And every time you need to see your log, just type in
Or, if you want to see the lines that changed
NB: If you want to see a list of aliases set up on your linux box, just type alias at the prompt.
Simply add color to your git environment:
Learn git from your browser: https://try.github.io/levels/1/challenges/1
To avoid doing all the time:
You can do:
You next, you will just have to do:
Find which commit is breaking the test with 'git bisect'
You may be in situation where you come back from holidays and find the tests that were passing before broken.
Git can help to find which commit produced the failure.
To start bisect, run:
You know that the tests are failing so you indicate it with:
You checkout an earlier revision when you know that the tests were passing (git log can help):
Then run the tests, and if they are passing, indicate it:
Once you have indicated that once it was bad and once it was good. You can leave git bisect do the job automatically:
You can now grab a coffee and come back few minutes later to see what commit made the tests failed.
Finally, you also need to come back to the original revision:
What is the original commit of a git repository?
You know git log to see the history of he commits.
Once you get the results of git log, you can do 'G' (capital G) to inverse the order of commits and see the first one in time.
Reduce the size of a git repository with the garbage collector