private git repositories in bitbucket

Submitted by alexmoreno on Tue, 11/06/2012 - 23:33

Let me got directly to the point. The bitbucket documentation is wrong, on the begining you are just suposed to do a git remote add origin

in the directory which you want to commit. But this will not work:

fatal: Not a git repository (or any of the parent directories): .git

Solution? Init the repository:

git init

git remote add origin https://ACCOUNT@bitbucket.org/ACCOUNT/REPOSITORY.git

git push -u origin master

will also don´t work :-(. The problem is that the message error is all but obvious.

 

error: src refspec master does not match any.

error: failed to push some refs to 'https://ACCOUNT@bitbucket.org/ACCOUNT/REPOSITORY.git'

 

But, think... we need to have something to commit before sending this "thing", don't we?

Then:

git add .

git commit -m "first commit with all the contents

And, finally, we send the commits with the changes in our code:

git push -u origin master

 

remote: bb/acl: hispamedios is allowed. accepted payload.

To ....

 

Nice, isn't it?

categorias