Created
September 18, 2017 08:13
-
-
Save kaleocheng/e41119e317bdbcf192d108d2a3efbad2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add init repo | |
mkdir hello | |
cd hello | |
git init | |
echo "Hello World" > README.md | |
git add . && git commit -m "Add README.md" | |
# Add empty vendor dir | |
git checkout --orphan vendor | |
git reset --hard | |
git commit --allow-empty -m "Initializing vendor " | |
git push origin vendor | |
git checkout master | |
# Add worktree | |
git worktree add -B vendor vendor origin/vendor | |
# Done, you can commit in two branches separately | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment