Create a new blank branch (NEW_BRANCH)
bash
git checkout --orphan NEW_BRANCH
git rm -rf .Add a single file (need to have a commit)
bash
touch README.md
git add README.md
git commit -m "initial"Delete the branch you want to remove (OLD_BRANCH)
bash
git branch -D OLD_BRANCHRename the current branch (NEW_BRANCH) to the deleted branch (OLD_BRANCH)
bash
git branch -m OLD_BRANCHPush your changes
bash
git push -f origin OLD_BRANCHKeep reading
git worktree as a daily driver
The git feature that finally cured me of having five clones of the same repo in different directories.
·3 min read
Copy from a Protected Google Sheet/Doc
Google Docs/Sheets give users ability to 'lock' their content. This makes files viewable but no editing or copying will work. Here is how to copy from a protected Google Sheet/Doc.
·2 min read