DEV Community

Discussion on: Git hacks you should know about

Collapse
 
randomnoun7 profile image
Bill Hurt

I also like to use this to see where all my branches are tracking from:

git branch -vv

It tells me which branches currently exist on my machine and which remotes and branches they are tracking. This is useful if you work with a team and you add their remotes to pull their branches down. It can get confusing to keep track of which branches are pointing where so you know where code is going to land when you run git push or where the changes are coming from if you do a git pull.

>git branch -vv
  master                                            d5e2de1 [puppet/master] Merge pull request #297 from clairecadman/sqlserver_doc_edits
  release                                           bddc857 [puppet/release: behind 2] Merge pull request #295 from dylanratcliffe/MODULES-8685-removing-instances-doesnt-work
* tickets/master/MODULES-8610-invoke-agent-job-task bddc857 [bill/tickets/master/MODULES-8610-invoke-agent-job-task] Merge pull request #295 from dylanratcliffe/MODULES-8685-removing-instances-doesnt-work
  tickets/release/MODULES-8721-release-prep-2.4.0   8454979 [bill/tickets/release/MODULES-8721-release-prep-2.4.0] Release Prep 2.4.0

The branch with the asterisk is the one I currently have checked out.