2

i am working on master branch cloned by command git clone -b master [email protected]:/home/github/jobsite

where [email protected]:/home/github/jobsite repository contains a lots of branches

i usually do git pull and git push to pull and push my works.

now as i want to merge branch forum into master.

so i cloned the branch by command git checkout --track origin/forum, and merged it with master.

now the problem is git push & git pull is not working correctly?

1
  • 2
    Post error message, please. Commented Aug 19, 2013 at 15:04

2 Answers 2

2

You need to specify which branch to push and pull from since you have master and forum

git pull origin forum/master
git push origin forum/master
Sign up to request clarification or add additional context in comments.

Comments

1

From the git manpage:

The special refspec : (or +: to allow non-fast-forward updates) directs git to push "matching" branches: for every branch that exists on the local side, the remote side is updated if a branch of the same name already exists on the remote side. This is the default operation mode if no explicit refspec is found (that is neither on the command line nor in any Push line of the corresponding remotes file---see below) and no push.default configuration variable is set.

As I recall, this default will change, you're not the first person who didn't expect this. If you think about it, though, it's the default you'll usually wind up explicitly configuring, because you very rarely want to mistakenly push every private branch to a shared repo.

Once you've pushed the branch explicitly, once, the default push will work.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.