Created
November 20, 2014 23:11
-
-
Save richjava/8718ae1975422884bf6c to your computer and use it in GitHub Desktop.
Netbeans Git HelloWorld
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
************************Create a remote repo************************ | |
Log in to your Github page > Repositories > New > Write repository name (i.e. HelloWorld) > Write a description (i.e “My first project on Github”) > Leave “Public” checked > Check “Initialize this repository with a ReadMe”. > Create Repository. | |
On the repository details page copy the clone URL (in the right column textbox) to clipboard. | |
************************Create a new project on Netbeans************************ | |
Call it HelloWorld (the name doesn’t need to be the same as the Github repo, but it makes sense to do so). | |
************************Create a local repo************************ | |
Select Project in Project Explorer Window > Team > Git > Initialize Repository > OK | |
Notice that files are green. This means they are not being tracked yet. | |
************************Add and Commit************************ | |
Netbeans will take care of the adding stage if you commit files directly. | |
Right click on the project > Git > Commit > Add commit message “First commit” (leave all files checked) > Commit | |
Now all the files in the project have turned to black because they have been committed. | |
************************Pull************************ | |
Before you can push to your Github repository, you will need to pull unmerged commits into the local branch (in this case, just the ReadMe). | |
Right click on the project > Git > Remote > Pull > Check “Specify Git Repository Location” > Leave Remote Name as origin > Paste in the clone URL that you copied from the Github remote repo > Input your Github username and password > Next > Leave “master -> origin/master [A]” checked > Finish > Merge. | |
************************Push************************ | |
Now you are going to push your commits (which in this case is the whole project) to the remote repo on Github. | |
Right click on the project > Git > Remote > Push > Select Configured Git Repository Location > Next > Check “master -> master [U] > Next > Leave “master -> origin/master [U]” checked > Finish. | |
Go to Github to see your files have been pushed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment