Reputation: 1599
For my first commit to an empty repo on Bitbucket. Which of the following commands do I use?
git push -u origin master
git push origin master
git push -u origin
What is the difference between these?
Upvotes: 2
Views: 2910
Reputation: 555
Well, -u is for "upstream" if I remember well, setting the current branch as the "default" branch for your project.
Master is the name of the branch, so just use "master" as default if you have only one branch, else use the name of the branch you want to use.
Origin : "origin is just an alias for an end-point, which can realistically be anything." – @Stephan Bijzitter who added a comment to my post to correct it, I think it's better to edit with the right answer.
Upvotes: -1
Reputation: 172
For example if you are working on your local repository on the directory /example, and you change a file a.txt
.
Do the following steps for push a.txt
:
git add /example/a.txt
git commit -m 'Comment for commit'
git push -u origin master
You can see the state of your repository using:
git status
Upvotes: 2
Reputation: 21
First is right
git push -u origin master
but it doesn't matter, initial commit = another commit
:)
Upvotes: 1