Quantcast
Channel: How do I get the current branch name in Git? - Stack Overflow
Viewing all articles
Browse latest Browse all 96

Answer by Prateek Gangwal for How do I get the current branch name in Git?

$
0
0

you can use git bash on the working directorycommand is as follow

git status -b

it will tell you on which branch you are on there are many commands which are useful some of them are

-s

--shortGive the output in the short-format.

-b--branchShow the branch and tracking info even in short-format.

--porcelain[=]Give the output in an easy-to-parse format for scripts. This is similar to the short output, but will remain stable across Git versions and regardless of user configuration. See below for details.

The version parameter is used to specify the format version. This is optional and defaults to the original version v1 format.

--longGive the output in the long-format. This is the default.

-v--verboseIn addition to the names of files that have been changed, also show the textual changes that are staged to be committed (i.e., like the output of git diff --cached). If -v is specified twice, then also show the changes in the working tree that have not yet been staged (i.e., like the output of git diff).


Viewing all articles
Browse latest Browse all 96

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>