Help with Github integration...last step

I just ran through the GitHub integration doc, including the GitHub bootcamp…thanks, and have everything all setup.
At the very end I wanted to run through the commands to get the latest code from the SmartThingsPublic repository even though I just set it up and it should already be updated. I am getting tripped up at the step to Push changes to my remote fork from my local repo.
I was able to run the following commands to update my local repo from the ST public repo:

git fetch upstream
git checkout master
git merge upstream/master

When I ran the checkout and merge it said I was already up to date, as expected.

While my current directory was the root of my local repo:

C:\Users\Swindmiller\Documents\GitHub\SmartThingsPublic [master]>

I ran:

git push origin/master

I got:

C:\Users\Swindmiller\Documents\GitHub\SmartThingsPublic [master]> git push origin/master
fatal: You are pushing to remote 'origin/master', which is not the upstream of
your current branch 'master', without telling me what to push
to update which remote branch.

git remote -v shows:

git remote -v
origin  https://github.com/swindmiller/SmartThingsPublic.git (fetch)
origin  https://github.com/swindmiller/SmartThingsPublic.git (push)
upstream        https://github.com/SmartThingsCommunity/SmartThingsPublic.git (fetch)
upstream        https://github.com/SmartThingsCommunity/SmartThingsPublic.git (push)

which looks right to me.

This is my very first experience with github so I am sure its just a stupid mistake on my end :blush:
This is a good way for me to learn GitHub :smile:

Thanks,
Scott

Edit: I may have found my answer…see the next post

OK so everything is working but the Push from my Local to my remote fork.

Per the docs after my local (clone) on my remote fork is updated from the main SmartThingsPublic repository I run:

git push origin/master

to push changes to my remote fork (where the IDE will see it) but I keep getting:

fatal: You are pushing to remote 'origin/master', which is not the upstream of
your current branch 'master', without telling me what to push
to update which remote branch.

I am a total GitHub newbie and just need a little help :smile:

I reached out to support and was told I needed intermediate level GitHub training found here :frowning:
https://training.github.com/kit/intermediate/#starting-on-the-command-line
That did not help me understand what I am doing wrong.

Please help :smile:

Thanks,
Scott

AHHHHHH! I think I may have fixed it. I was running:

git push origin/master

per the docs.

after poking around some more I tried:

git push origin master

and that seemed to work :smile:

Can someone verify that this is correct?

One wrong character is all it takes to make a big negative difference ("/" instead of a space)!

I make this mistake all the time when using git. Clearly it spilled through into the docs.

You are correct, and I am so sorry you had to figure it out yourself. The docs are updated now.

2 Likes

Hey, part of learning is figuring it out yourself :smile: that’s how I learn. I am just glad to see that I did everything else correctly.

Thanks for chiming in!