I have code on my server at /var/www/virtual/joel.co.in/droidzone.in/htdocs/keys. I wish to import it to a new Git repo on bitbucket.
First create the empty repo on Bitbucket: Visit
Now, on the server, navigate to the directory containing the code you need to import.
Now initialize an empty repo
#git init . Initialized empty Git repository in /var/www/virtual/joel.co.in/droidzone.in/htdocs/keys/.git/
Now, add your files to it, and make the first commit.
git add . git commit -a
Add a remote to it:
#git remote add origin ssh://[email protected]/droidzone/securessh.git
Push everything for the first time:
#git push -u origin --all Counting objects: 4, done. Delta compression using up to 4 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (4/4), 1.19 KiB, done. Total 4 (delta 0), reused 0 (delta 0) To ssh://[email protected]/droidzone/securessh.git * [new branch] master -> master Branch master set up to track remote branch master from origin.
Joel G Mathew, known in tech circles by the pseudonym Droidzone, is an opensource and programming enthusiast.
His favorite pastime is grappling with GNU compilers, discovering newer Linux secrets, writing scripts, hacking roms, and programs (nothing illegal), reading, blogging. and testing out the latest gadgets.
When away from the tech world, Dr Joel G. Mathew is a practising ENT Surgeon, busy with surgeries and clinical practise.