Sunday, May 10, 2015

Create a new Git repository for new / existing project in Netbeans while putting it on Bitbucket

First, there are free accounts at Bitbucket.org, up to 10 users, no obligations, private repositories.

Create a Bitbucket account. Login. Go to "Repositories" menu at the top screen bar and select "Create repository". Add the repository name and other info and create the repository. When done, copy & paste the URL which now appears in the browser, e.g. "https://bitbucket.org/david_mail/my_new_repository".

Open your Netbeans project (I am currently using NB 8.0.2), right click on the project name, select "Versioning"->"Initialize Git Repository". Next, right-click again on the project name and select "Git"->"Commit".

Your project is no in th elocal repository. Let's connect it to teh remote repository so they'll auto-merge. At top NB menu open "Team"->"Remote"->"Push".
If it is the first time you add this Git repository put the Bitbucket' repository URL in "Specify Git Repository Location / origin"->"Repository URL" and provide your user credentials for Bitbucket. Hit "Next" and "Finish" buttons and you are done.