While I do have a GitHub account, I’ve decided to give BitBucket a try. The biggest selling point for me is that they have unlimited private repos. I still think GitHub is better for the general open source community, since more developers are on that site so it’s one less account they have to create when they are contributing to a particular project. But for tinkering on small, personal projects, it seems like BitBucket is more along the lines of what I’m looking for.

After creating a BitBucket account, I went ahead and setup SSH so that I could use a SSH connection (and avoid the username/password hassle of using HTTPS) to push to my BitBucket repo. BitBucket provides pretty thorough instructions on how to do that here: https://confluence.atlassian.com/display/BITBUCKET/Use+the+SSH+protocol+with+Bitbucket

Getting BitBucket up and running was relatively straightforward. I created an empty repo on the BitBucket site. Then, on the client side, I decided to go with EGit since I was using Eclipse to do my dev work. My version of Eclipse came with EGit installed, so there’s no need to install additional software. Looking at this tutorial, I skipped to Section 5 to start configuring Git in Eclipse. Note that, instead of using ‘/home/username/’ I used ‘/Users/username/’ since I was doing this on a Mac. What I like about the EGit interface is the Git Staging Perspective that they have. It makes it super easy to see what hasn’t been staged, what’s been staged and waiting to be committed, and what’s already been committed.

To push the changes to a cloud Git server, just run these commands:

cd /path/to/my/repo
git remote add origin ssh://git@bitbucket.org/username/helloworld.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

Leave a Comment

Your email address will not be published. Required fields are marked *