I have created a local branch
(master)$git checkout -b om-dev
(om-dev)$git branch -u origin/dev
Fig1: Show the tracking connection of local 'om-dev' to remote 'dev' from origin
(om-dev)$git branch -vv
Fig2: Confirm that my local branch is tracking remote correctly
I have some local commits on 'om-dev' that I want to push to 'dev'
(om-dev)$git status
Fig3: Show local branch is ahead of remote
Now, issue comes here:
(om-dev)$git push
Here, I expect to push my commit from om-dev branch to remote 'dev' branch without using full syntax ($git push origin dev or, $git push -u origin dev) But, I am seeing following complaint:
Fig4: Complain pushing local branch, even after successful upstream set already
Question: Why do I again need to track my branch using -u in my push statement? Shouldn't logically after already setting upstream, it should be able to resolve the remote branch and source when I only use 'git push' command.
Note: I have already tried using -u option, and it works as expected. But I am expecting why it doesn't work this way? The git version being used is: 2.19.1.windows.1