pushing local Git branch to Github

. 1 min read

So today I worked on a local branch repo, and wanted to push my update to Github.

I Googled for reference and found this great article by Mario Pareja.

The only thing I would add on top of his piece is to step back and actually illustrate what's origin.

So inside your repo;

$ git remote -v

should display your Github (or remote) repo that belongs to origin.

origin  [email protected]:[your-github-username]/bazaar.git (fetch)
origin  [email protected]:[your-github-username]/bazaar.git (push)

Pushing your local branch to Github (or remote repo)

Now how to push your local branch into your Github repo looks like;

$ git push origin [branch_name]

In my case, it was;

$ git push origin dev_gems

Mario added -u in between push and origin so that the next time he does git push, it's gonna remember it as git push origin dev_gems.