Posted in Software Engineering

Bit Bucket – init repository

Bitbucket has a bit imprecise documentation about pushing an existing code to their repo. If you have an existing directory without git control, and would like to push it to bitbucket, you may get the following error:

No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as 'master'.
Everything up-to-date

Here is how to solve it.

# go to the directory containing your existing project
cd /your/project
# initialize git
git init
# add "www" directory"
git add www
# commit it locally
git commit -m "initial commit"
# add it to bitbucket repository
git remote add origin https://username@bitbucket.org/xxxxx/sitename.git
# finally, this one will push it to bitbucket
git push -u origin --all

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s