1

every time I have to push my branch to remote on GitHub I have to run the following command,

git push --set-upstream sensorAtHome WIP

however at office I just go ahead and push to our company cgit server.

so what is different and what do I need to do, locally for my GitHub project I have a already done this:

git remote add <name> <url>

I thought that was enough .

secondly what <name> refers to name of branch or name of repository?

Ciasto piekarz
  • 6,378
  • 11
  • 59
  • 149
  • `` is the name of the remote. It's the name you're gonna use to refer to that ``. `sensorAtHome` is a remote name. As for the rest of your problem, `git push --set-upstream` should do it. Could you show the ***full text*** of what happens when you run that command? Also the content of `.git/config` in that repository. – Schwern Jan 26 '17 at 05:38

1 Answers1

1

Check your git branch -avv output, as well as git remote -v

Your office branch is probably already linked to a remote tracking branch.

See "Why do I need to explicitly push a new branch?"

You should push once with:

git push -u sensorAtHome WIP

Then a simple git push would be enough: your local branch would know where and to which branch to push ("where" is sensorAtHome remote url, and "which branch" is sensorAtHome/WIP)

Community
  • 1
  • 1
VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283