Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Blogs > omgiamlinux
User Name


Rate this Entry

Day 4.7 How to use with NetBeans 7.0

Posted 10-27-2011 at 04:52 PM by omgiamlinux
Updated 10-27-2011 at 06:33 PM by omgiamlinux

a. Install git on your computer (I did this with git bash on windows)
b. Install NetBeans
c. Setup a free account at
d. Install a plugin called git in NetBeans
Tools -> Plugins -> Available Updates (TAB) -> git (checkbox) -> Install (button)

I. To import a new project into NetBeans from git hub, perform the following.

1) In git bash, move to your NetBeansProjects folder and clone a repo:
$  cd ~/documents/netbeansprojects
$  git clone git:// hellogit_php
That will give you readonly access. To do read/write access, use this clone command instead:
$  git clone hellogit_php
(note: If you attempt this second command, your terminal will give you jazz about not having permissions. That's because I haven't added your SSH key to my white list of keys on my github account. Play around with your own account for maximum fun).

That will download the project files into your NetBeans folder (explicitly naming it's folder hellogit_php which was redundant in this case, btw). You can now open the project in NetBeans by:

1) Open up NetBeans
2) File -> Open Project
Your project should be visible in the panel displayed to you! Select it and click "Open Project" =)

Make an arbitrary change to your index.php file. I decided to add a line to the php section:
echo "<br>pweez?";
Save the change, and right click the project node.

git -> Add
git -> Commit
After you click on the "Commit" item, you'll be presented with a panel that wants you to add a message to your commit. I just filled in something about adding a pweez line.

Then you're done in NetBeans. Drop back into the git bash so you can push the repository up to origin.
$  cd ~/documents/netbeansprojects/hellogit_php
$  git push -u origin master
BooYah! You just uploaded your changes! Aren't weblogs fun! Of course you would only be aloud to upload your changes if it was your account and you added your ssh key to the white list in

II. To upload a NetBeans project to github

1) Create a blank PHP project in NetBeans.
2) Create a new repository on
3) Drop into git bash

4) cd to the new PHP project's folder and prepare the git repository.
$  git init
$  git remote add origin < insert your user account name > / < insert your github project name >.git
5) Add all the NetBeans files to the repository of course.
$  git add .
$  git commit -m 'first commit of every file in the NetBeans project'
Then you may push the repository into the space you created for it on
$  git push -u origin master

OK, I've been banging out so many tutorials these last few days, I have a feeling I'm running out of steam, so plz, if you try following this and things don't work out for you, let me know below.
Views 759 Comments 0
« Prev     Main     Next »
Total Comments 0




All times are GMT -5. The time now is 12:07 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration