Search code examples
gitatlassian-sourcetreesourcetree

How to view the state of a git repo using command line


I use SourceTree mostly to work with git which lets me understand the current state of the repo easily. Given a repo which has lots of branches is it possible or easy to understand the current state of the repo using command line?


Solution

  • Yes. Try

    git status
    

    to get brief information about the current status (untracked or changed files). Use

    git branch -vav
    

    to see the list of all branches with some information on them (what remote branches they track and how synchronized with them they are). Use

    git log --oneline --graph --decorate --all
    

    to see the history with branches in colours.