Import exising code into a new bitbucket git repo

Create the new repo on Bitbucket.
Now, on your shell, navigate to the directory containing code you need to import.

cd /var/www/virtual/

Initialize a git repo, add all files, and make the first commit:

git init .
git add .
git commit -a

Now, add a new remote for the repo:

git remote add origin ssh:[email protected]/droidzone/phpscripts_kgimoa.git

You can get the address from bitbucket (choose to Push up an existing repository)

Now, push your code:

git push -u origin --all

You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.