No remote for the current branch - GIT

A merge between two local branches of your local repo should not require any "remote" (which is a reference to an upstream repo URL)

But: As mentioned in git merge man page, section CONFIGURATION:

If merge is called without any commit argument, merge the upstream branches configured for the current branch by using their last observed values stored in their remote-tracking branches.

The values of the branch.<current branch>.merge that name the branches at the remote named by branch.<current branch>.remote are consulted, and then they are mapped via remote.<remote>.fetch to their corresponding remote-tracking branches, and the tips of these tracking branches are merged.

So, if you want to merge another local branch into your current checked out branch, don't just type git merge (which would trigger the fatal: No remote for the current branch. error message)

Type:

git merge anotherBranch

You will need to add a remote later if you want to push to an upstream repo.

See more with: "Definition of “downstream” and “upstream”".

Tags:

Git