In Mercurial, I usually do this:
hg init
hg addremove
hg commit -m "init repo"
hg push https://arezzo:mypassword@bitbucket.org/arezzo/mynewrepo
I tried something similar in git and it didn’t work:
git init .
git add .
git commit -m "init repo"
git push https://arezzo:mypassword@bitbucket.org/arezzo/mynewrepo
The message I get after push is:
Everything up-to-date
Nothing gets pushed to bitbucket.
When you don’t specify a branch to push when you’re using
git push, it by default will only push branches where a branch with the same name exists in the remote repository. In this case, I guess that this is the first time that you’re pushing to this repository, so there is no branch calledmasteryet – thus,git push URLdoesn’t push anything.Another tip that may be useful is that you usually create a
remoteas a short name for the repository URL when you’re using git. So, to modify your steps slightly, try the following instead:Then you can use
originin place of the URL. You only need to use the-uoption the first time that you push – it just sets up some helpful default config options so thatgit pullworks without additional arguments, for instance.