Skip to main content

How to use Git and GitHub from Netbeans

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

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

Popular posts from this blog

How to get started with MongoDB

In my last post I gave you all a brief introduction about NoSQL databases and its uses. As I mentioned in my last post , in this blogpost I'll give you all an overview of MongoDB and how to get started using MongoDB. Basically MongoDB is a document-oriented, NoSQL database and it can be rated as the most popular and widely used NoSQL database. MongoDB is free and open source , therefore anyone can simply download it from their site and start using it in their applications. It stores data as JSON(JavaScript Object Notation) like documents with schemas. In fact, data is actually stored in MongoDB as BSON objects. BSON is very much similar to JSON except that it is the binary representation of JSON. Unlike JSON, BSON is optimized for performance and navigational abilities. Typically data will be stored in the format shown on the following picture.  Key features that had contributed to the huge popularity of MongoDB are as follows: Support Ad hoc queries together JavaScript ...

A comparison between Node and Express

If you are programmer who have worked a long time with JavaScript you might know that , earlier JavaScript was just a scripting language used in the client side. However now the story is different. With many libraries like Node js and Express js being added to the JavaScript family JavaScript have evolved beyond, just being a scripting language in the client side. With these new libraries being added, now it is possible to build entire sites on JavaScript, extending it from front to back-end seamlessly. So what is Node and Express? Let's  clear this out step by step! What is Node js? Node js is an open source JavaScript runtime environment that executes JavaScript code server side. Node enables developers to use JavaScript for server side scripting. Node uses an event driven, non-blocking I/O model that makes it light weight and efficient. Because of this model Node js is particularly useful in web application that have many input/output operations and for real time web appli...

Difference between callback functions and promises in javascript

If you have ever worked with JavaScript you might have the experience that it is a quite confusing language to understand at first. This is because  in JavaScript there are many ways to do the same thing, and also unlike most other programming languages, if you do a small mistake in JavaScript instead of giving any errors, the program would behave in a totally different way than what you expect. Therefore, without understanding the basic concepts of JavaScript, it's quite difficult to work with it. In this post I'll be explaining about callback functions and promises, what they are used for and the difference between the two methods. Actually callback functions and promises are 2 different ways of doing the same thing. By default JavaScript is an asynchronous programming language. Which means that JavaScript does not execute instructions line after the other as in many programming languages. Whenever JavaScript come across an operation that takes relatively a long time, typic...