Skip to content

Instantly share code, notes, and snippets.

@tduarte
Last active March 15, 2024 05:45
Show Gist options
  • Save tduarte/eac064b4778711b116bb827f8c9bef7b to your computer and use it in GitHub Desktop.
Save tduarte/eac064b4778711b116bb827f8c9bef7b to your computer and use it in GitHub Desktop.
If you need to force push an subtree
git checkout master # you can avoid this line if you are in master...
git subtree split --prefix dist -b gh-pages # create a local gh-pages branch containing the splitted output folder
git push -f origin gh-pages:gh-pages # force the push of the gh-pages branch to the remote gh-pages branch at origin
git branch -D gh-pages # delete the local gh-pages because you will need it: ref
@Vandivier
Copy link

much amz very

@tim-minshall
Copy link

This is amazing thank you!!!

@sampolahtinen
Copy link

brilliant thanks! :)

@dwgrossberg
Copy link

still here, thank you again

@PancakePhilarmonych
Copy link

git push origin git subtree split --prefix dist master:gh-pages --force

Thank you so much! 🫶🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment