I have a branch named gh-pages
which contains index.html
because it actually from main branch inside a folder named public
. I'm using nodejs for tailwindcss, my directories in main so when I'm pushing that certain folder only, I will use the command
git subtree push --prefix public origin gh-pages
which I got from here which normally works. but then today I added a new folder inside it called tictactoe
which only got HTML and JS file and using ../style.css
from previous directory then I got this error which says updates were rejected because a pushed branch tip is behind its remote counterpart. check out this branch and integrate the remote changes (e.g. 'git pull ...') before pushing again.
.
I tried various solution from this site such as
git push -f origin gh-pages
from here but it says Everything up-to-date
then I tried pull using git pull -f origin gh-pages
but it says fatal: refusing to merge unrelated histories
so I tried git pull origin gh-pages --allow-unrelated-histories
from here which happens it actually pull but I still can't push the subtree normally and receives the same error as this title.