Day 4.7 How to use github.com with NetBeans 7.0
Prerequisits:
a. Install git on your computer (I did this with git bash on windows)
b. Install NetBeans
c. Setup a free account at github.com
d. Install a plugin called git in NetBeans
Hint:
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:
That will give you readonly access. To do read/write access, use this clone command instead:
(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:
Save the change, and right click the project node.
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.
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 github.com
II. To upload a NetBeans project to github
1) Create a blank PHP project in NetBeans.
2) Create a new repository on github.com
3) Drop into git bash
4) cd to the new PHP project's folder and prepare the git repository.
5) Add all the NetBeans files to the repository of course.
Then you may push the repository into the space you created for it on github.com
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.
a. Install git on your computer (I did this with git bash on windows)
b. Install NetBeans
c. Setup a free account at github.com
d. Install a plugin called git in NetBeans
Hint:
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:
Code:
$ cd ~/documents/netbeansprojects $ git clone git://github.com/thisismygit/hellogit_php.git hellogit_php
Code:
$ git clone git@github.com:thisismygit/hellogit_php.git hellogit_php
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:
Code:
echo "<br>pweez?";
Code:
git -> Add git -> Commit
Then you're done in NetBeans. Drop back into the git bash so you can push the repository up to origin.
Code:
$ cd ~/documents/netbeansprojects/hellogit_php $ git push -u origin master
II. To upload a NetBeans project to github
1) Create a blank PHP project in NetBeans.
2) Create a new repository on github.com
3) Drop into git bash
4) cd to the new PHP project's folder and prepare the git repository.
Code:
$ git init $ git remote add origin git@github.com: < insert your user account name > / < insert your github project name >.git
Code:
$ git add . $ git commit -m 'first commit of every file in the NetBeans project'
Code:
$ 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.
Total Comments 0