Using Bitbucket

Hi,

Whenever I try using bitbucket for managing a project code, I always face the basic steps to create a repo whithin bitbucket :P. So, I decided to include here, these basic or initial steps as described originally by bitbucket.

I’m strating from scratch:

Set up your local directory

Set up Git on your machine if you haven’t already.

$ mkdir /path/to/your/project
$ cd /path/to/your/project
$ git init
$ git remote add origin https://username@bitbucket.org/username/project.git

Create your first file, commit, and push

$ echo "XXXXX" >> contributors.txt
$ git add contributors.txt
$ git commit -m 'Initial commit with contributors'
$git push -u origin master

I have an existing project:

Already have a Git repository on your computer? Let’s push it up to Bitbucket.

$ cd /path/to/my/repo
$ git remote add origin https://username@bitbucket.org/username/project.git
$ git push -u origin --all # pushes up the repo and its refs for the first time
$ git push -u origin --tags # pushes up any tags

That’s all,

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s