git push origin -u code example
Example 1: git check upstream url
git remote show origin
Example 2: show remote git
# when you are not connected to the network, you can use this
git config --get remote.origin.url
Example 3: git push origin
git branch -M main
then
git push -u origin main
or
git push -f origin main
or
git push origin master --force
Example 4: push u git
$ git push -u origin test
Branch test set up to track remote branch test from origin.
Everything up-to-date
$ git pull
Already up-to-date.