Mathieu PATUREL Posted on Sep 24, 2017 Programmatically get current git branch #git #bash #branch #ps1 Nice and easy. Works with git 1.6.3 and higher. $ git rev-parse --abbrev-ref HEAD master Enter fullscreen mode Exit fullscreen mode Top comments (1) Subscribe Submit Preview Dismiss Collapse Expand Rabbi Shuki Gur Rabbi Shuki Gur Rabbi Shuki Gur Follow An IDF veteran Software Engineer, A loving and caring father, And a Rabbi at multiple Chabad Centers around the globe. Location Israel Education IDF Work Fullstack Software Engineer at Matrix Joined Feb 7, 2019 • Feb 13 '19 Dropdown menu Copy link Hide You can also use any of the following. Windows: git branch | findstr \* Linux: git branch | grep \* Code of Conduct • Report abuse
Top comments (1)
You can also use any of the following.
Windows:
git branch | findstr \*Linux:
git branch | grep \*