TME 310 - Computational Physical Modeling
University of Washington Tacoma
git pushMost of the problems I’ve seen with git push might look something like this:
! [rejected] main -> main (fetch first)
error: failed to push some refs to 'https://github.com/UWT-TME-310/...
The most likely cause is that your codespace is “behind” your repo (aka origin).
Before attempted push:
A---B---C (origin/main)
\
D---E (codespace/main)
Use these commands:
git config pull.rebase false
git pull
You’ll be prompted for a commit message
Before attempted push:
A---B---C (origin/main)
\
D---E (codespace/main)
After git config pull.rebase false AND git pull:
A---B-------C (origin/main)
\ \
D---E---F (codespace/main)
Now you can git push
After git push:
A---B-------C F (origin/main)
\ \ /
D---E---F (codespace/main)
Even if you don’t try the previous method, you can ask Copilot to help you.
If you’re really tangled in a knot, make a copy of what you want to keep locally and start a new codespace from your repo.
You might also have problems with the codespace itself…
codespace running in recovery mode…There is no Pip installer…