Skip to content

Commit 157337d

Browse files
committed
orphan branch
1 parent afa8747 commit 157337d

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
* [Instantly browse your working repository in gitweb.](https://github.com/git-tips/tips#instantly-browse-your-working-repository-in-gitweb)
9898
* [View the GPG signatures in the commit log](https://github.com/git-tips/tips#view-the-gpg-signatures-in-the-commit-log)
9999
* [Remove entry in the global config.](https://github.com/git-tips/tips#remove-entry-in-the-global-config)
100+
* [Checkout a new branch without any history](https://github.com/git-tips/tips#checkout-a-new-branch-without-any-history)
100101

101102
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
102103
<!-- @doxie.inject end toc -->
@@ -665,5 +666,10 @@ git log --show-signature
665666
git config --global --unset <entry-name>
666667
```
667668

669+
## Checkout a new branch without any history
670+
```sh
671+
git checkout --orphan <branch_name>
672+
```
673+
668674
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
669675
<!-- @doxie.inject end -->

tips.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,4 +296,7 @@
296296
}, {
297297
"title": "Remove entry in the global config.",
298298
"tip": "git config --global --unset <entry-name>"
299+
},{
300+
"title": "Checkout a new branch without any history",
301+
"tip": "git checkout --orphan <branch_name>"
299302
}]

0 commit comments

Comments
 (0)