As some of  you all might know Git is a popular version control tool for tracking changes in computer files and managing work among several people. GitHub is a web-based Git or version control repository and Internet hosting service. GitHub helps you to host and review code, manage projects and build software alongside millions of other developers. The whole scenario of using Git and GitHub is based on creating a repository where you can save your code. Git allows you to create a local repository on your own PC, whereas GitHub enable you to push/copy the content of your local repository to a global(remote) repository where other developers can access your code. This blog is about how to configure and use Git and GitHub from the NetBeans IDE.
1. Install Git on your PC.
You can download it from the following link . URL : Download Git
  
Copy your GitHub repository URL to the repository URL on the above window. You can get URL by selecting the HTTPS tab on your GitHub repository.
1. Install Git on your PC.
You can download it from the following link . URL : Download Git
2.Create a GitHub account.
 If you already have one just sign in to that account. Go to GitHub     
3. Create a local repository.
To create a local repository, you should first open your NetBeans IDE and select your project. Then on the menu bar of the NetBeans IDE go to Team → Git → Initialize Repository. Following window will pop up.
Click OK and you'll have your local repositray initialized on your PC.
4. Create a new repository in GitHub.
5. Push your local repository in to the GitHub repository.
Once you have initialized a local repository items in the Team menu of the NetBeans menu bar will change. Now select Team → Push.
Copy your GitHub repository URL to the repository URL on the above window. You can get URL by selecting the HTTPS tab on your GitHub repository.
Then give your GitHub account's username and password . Click Next and you'll be prompted to select the branch of the repository that you want to push your project.
By default when we create a GitHub repository it will create a master branch which is the main branch. Later on we can create other branches according to our need, but at this point we have only the master branch so select it. Click next and finally Finish. 
Refresh your GitHub page and you'll see your project uploaded onto your GitHub repository.
These are the main steps that we need when we are working with Git, GitHub and NetBeans, but apart form these there are many other useful Git operations. For an example,
- Commit - Save any changes you have made, to your repository
- Diff - Track any differences in your current project and the project uploaded to your repository.



Comments
Post a Comment