diff --git a/README.md b/README.md index 36cce35..253fcaf 100644 --- a/README.md +++ b/README.md @@ -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) @@ -431,5 +432,10 @@ git bundle create git clone repo.bundle -b ``` +## Get the name of current branch. +```sh +git rev-parse --abbrev-ref HEAD +``` + diff --git a/tips.json b/tips.json index 0e076de..02ccfdc 100644 --- a/tips.json +++ b/tips.json @@ -243,5 +243,9 @@ { "title": "Import form a bundle", "tip": "git clone repo.bundle -b " + }, + { + "title": "Get the name of current branch.", + "tip": "git rev-parse --abbrev-ref HEAD" } ]