(Para español pulse aquí)

Let asume some things in order this How-To works fine:

- you have a local directory in your Linux machine (i.e. ~/workspace/project/)
- you want push your code in a remote Git repository
- you have installed Git, otherwise try:
    $ sudo apt-get install git-core git-gui git-doc
- you have created an account in Bitbucket

Bitbucket side:

1) First of all, you need to upload your SSH Public Key (~/.ssh/id_rsa.pub) to Bitbucket > Account.
2) Go to Repositories and create a new (empty) repository.

Linux machine side:

1) Go to local directory that contain your project.
    $ cd ~/workspace/project/

2) If you don't do this before, create an empty git repository or reinitialize an existing one.
    $ git init

3) Add a remote repo using Bitbucket's username and reponame and choice a name for the repo (i.e. origin)
    $ git remote add origin git@bitbucket.org:{username}/{reponame}.git

4) Add project files to the index.
    $ git add <files>

5) Commit your changes.
    $ git commit -m "some comment"

6) Push the code to Bitbucket.
    $ git push origin master

If everything goes fine, you can go to your Bitbucket's Dashboard and check and comment the changes.

I used BitBucket for two of my personal projects, Web de Juegos Gratis y Smart Analytics and I must say it's a very good alternative to maintain code. If you think this guide has been helpful, please consider visiting the site or download the apps, both projects funded by ads.


Rodrigo
9/11/2011

Cool! Thanks.

Reply
Malcolm
23/1/2012

Needed this! Thanks!

Reply
28/6/2015

Great tips! Why do you stop bloging?

Reply



Leave a Reply.

    Archives

    November 2011

    Categories

    All
    Android
    Graphics
    How To


    Some ads