Issue
On RedHat server 7.7
I ran the following commands.
git clone https://github.com/postgres/postgres.git
cd postgres
git remote add upstream https://github.com/postgres/postgres.git
git fetch upstream REL_12_STABLE
The output was as follows:
From https://github.com/postgres/postgres
* branch REL_12_STABLE -> FETCH_HEAD
instead of
From https://github.com/postgres/postgres
* branch REL_12_STABLE -> FETCH_HEAD
* [new branch] REL_12_STABLE -> upstream/REL_12_STABLE
If i run the git branch –r command, we DO NOT see an extra upstream/REL_12_STABLE entry
While on RedHat 8 every thing works fine.
Solution
Apparently (per comments) the Git version on RH7.7 was quite old, predating Git 1.8.4. (A google search suggests that it is in fact 1.8.3.1.) Very old versions of Git like this simply fail to create-or-update remote-tracking names like upstream/REL_12_STABLE
when using this form of git fetch
.
There are several cures or workarounds. Here are my top-two:
- Installing a newer Git version will fix it. (Note that a custom Git might live in a different directory from the system Git. This can be messy, but is generally supposed to work. You may need to adjust your
PATH
setting.) - Running
git fetch upstream
instead ofgit fetch upstream REL_12_STABLE
will work around it, although this has the disadvantage of fetching everything rather than just the one branch.
Answered By - torek