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?
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?
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
First is right
git push -u origin master
but it doesn't matter, initial commit = another commit
:)
I simply use:
git push
But make sure you cloned the repo first.
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.