GIT: Starting project in Bitbucket

Last updated on:

Starting 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/projectname.git

Create your first file, commit, and push

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

Already have 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/projectname.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
View Comments

Leave a Comment

Use markdown or basic HTML and be nice.