Get the name of the current branch

This commit is contained in:
Hemanth.HM 2015-09-19 17:59:32 +05:30
parent c0faf65fc9
commit affd2f840a
2 changed files with 10 additions and 0 deletions

View File

@ -61,6 +61,7 @@
* [Get latest changes in your repo for a linked project using subtree](https://github.com/git-tips/tips#get-latest-changes-in-your-repo-for-a-linked-project-using-subtree)
* [Export a branch with history to the a file.](https://github.com/git-tips/tips#export-a-branch-with-history-to-the-a-file)
* [Import form a bundle](https://github.com/git-tips/tips#import-form-a-bundle)
* [Get the name of current branch.](https://github.com/git-tips/tips#get-the-name-of-current-branch)
<!-- Dont remove or change the comment below that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end toc -->
@ -431,5 +432,10 @@ git bundle create <file> <branch-name>
git clone repo.bundle <repo-dir> -b <branch-name>
```
## Get the name of current branch.
```sh
git rev-parse --abbrev-ref HEAD
```
<!-- Dont remove or change the comment below that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end -->

View File

@ -243,5 +243,9 @@
{
"title": "Import form a bundle",
"tip": "git clone repo.bundle <repo-dir> -b <branch-name>"
},
{
"title": "Get the name of current branch.",
"tip": "git rev-parse --abbrev-ref HEAD"
}
]