• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • Featured
    • C# Tutorials
      • LinQ Tutorials
      • Facebook C# API Tutorials
    • PHP Tutorials
      • CodeIgniter Tutorials
    • Amazon AWS Tutorials
  • Categories
    • Programming
    • Development
    • Database
    • Web Server
    • Source Control
    • Management
    • Project
  • About
  • Write
  • Contact

CodeSamplez.com

Programming, Web development, Cloud Technologies

You are here: Home / Source Control / Using GIT Plugin For Netbeans IDE

Using GIT Plugin For Netbeans IDE

November 8, 2012 by Rana Ahsan 3 Comments

Git Tutorial

On this tutorial, I will try to describe, how easily we can use git operations from within the IDE with using git plugin for Netbeans. Also, I will like to mention that, git support for Netbeans IDE started since version 7.x . So, please make sure your ide is updated . I am using Netbeans IDE 7.3(beta) while, writing this tutorial. If you are very new with git, you should first get basic knowledge on GIT first. As this tutorial assumes you already know git more or less and now want to use the git plugin for Netbeans. As a short course, you can refer to my important git commands tutorial.

Installing The GIT Plugin For Netbeans:

Go To ‘Tools’->’Plugins’ menu on Netbeans. You should be able to see few tabs like ‘available plugins’, ‘installed plugins’, ‘Downloaded’ and so on. Click on he available plugins, select the ‘git’ plugin from the list and install. After installation , it will be shown on ‘installed’ tab as like the following picture:
Git Plugin Installation on Netbeans IDE

Initialize/Clone New Repository:

After the plugin in being installed, its time to create a new repository or clone a remote repository. Please got to ‘Team’->’Git’ menu option and you should see these options there.

If you are initializing new git repository, you can do so on an existing project directory or on an empty new directory. Just map the path, and you are done.

To clone a remote repository, you should see a pop up window as follows where you will need to enter corresponding information:
Clone GIT Repository From Netbeans IDE

After you click ‘Next’, it will connect to the remote repository and will show the branches on the repository, from which, you can select one or more branches. Then, on next screen, you will need to specify the place on your local PC where the clone operation will be held. Now, if you just click ‘finish’, it will start the cloning process and show the logs on Netbeans output window.

Operations We Can Perform With GIT Plugin For Netbeans:

Almost all available git operations can be performed through this plugin. If you right-click on your project and go to git option, you should see the available options you can use as like the image below:

Available Netbeans GIT Plugin Options

Perform Local Commit Using GIT Plugin:

This plugin makes commuting files easy! Just after you have completed all your addition/changes of files, you can just right-click the project, select “git->commit” option. It will show up a new dialog as follows:

Commit With Netbeans GIT Plugin

You can check which files are being committed and on which state(like ‘added’/’modified’/’deleted’ etc). So, basically you will be able to get rid of ‘git add’ type commands. After you added a proper comments and check all are ready, just click the ‘commit’ button, it will do the rest of the work and log will be shown on output window.

Branching And Merging:

Working with branches and merge operations are also very easy to handle with Netbeans git plugin. To create a branch, use the option ‘git->branch->create’ and you will see new dialogues as below:

Create Branch Using Netbeans GIT Plugin

From the first dialogue, you can enter your preferred branch name and if you want to select a specific revision, either from local or remote, you can do so from the second dialogue. Switching branch is similar, just need to select the preferred branch and revision(if needed) and click OK on switch branch dialogue.

For merging, you can select the ‘form’ branch with which your current branch will be merged. If any conflict occurs, you can resolve it from both graphical and textual editor as like the image below:

Comparing Files In Netbeans GIT Plugin

This same editor can be used to compare two version of a file. For such usage, you can use the ‘git->diff’ option.

Pull/Push/Fetch From/To Remote repository:

Working with remote are a lot painless than the basic command line tool. You won’t have to switch to bash agent, add ssh key or enter password again and again. You just do it first time. Especially, if you have cloned from a remote repository, it should already be saved and you won’t need to do anything again about this part. For pushing, you should just select the local branch which will be pushed to which remote branch(you can select more than one!) and it will take care of the rest and show the log on output window. However, I am missing a lot about the complete log report feature here than the command line tool as it shows only major logs not all like command line/terminal.

References:

Please refer to Official Netbeans documentation on git plugin for more. Also, you can ask any specific questions about usage of this git plugin for netbeans on comments as well. Happy coding 🙂

Share If Liked

  • Click to share on Facebook (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
  • Click to share on Reddit (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to share on Pocket (Opens in new window)

You may also like

Filed Under: Source Control Tagged With: git, plugin

About Rana Ahsan

Rana is a passionate software engineer/Technology Enthusiast.
Github: ranacseruet

Reader Interactions

Comments

  1. zwyxz says

    December 10, 2012 at 8:11 pm

    hey, using netbeans, can we do a diff between local branches, or local and remote ? afaik and as i try, git->diff only do diff in local sources, head/index/working tree.
    help appreciated. 🙂

    Reply
    • Md. Ali Ahsan Rana says

      December 29, 2012 at 9:17 am

      If yes, it does the diff operation on local branch. If you need to do so with remote branch, why not you first take update from remote branch and do the diff with remote’s latest branch?

      Reply

Trackbacks

  1. Basic Git Commands TutorialCodeSamplez.com says:
    December 24, 2012 at 3:49 am

    […] it you can have complete control over your git repository right from your IDE. Please checkout my git plugin for netbeans tutorial for […]

    Reply

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 3,774 other subscribers

Follow Us

  • Twitter
  • Facebook

Top Posts & Pages

  • How To Work With JSON In Node.js / JavaScript
    How To Work With JSON In Node.js / JavaScript
  • PHP HTML5 Video Streaming Tutorial
    PHP HTML5 Video Streaming Tutorial
  • How To Work With C# Serial Port Communication
    How To Work With C# Serial Port Communication
  • Facebook C# API Tutorials
    Facebook C# API Tutorials
  • Using Supervisord Web Interface And Plugin
    Using Supervisord Web Interface And Plugin
  • LinQ Query With Like Operator
    LinQ Query With Like Operator
  • Get Facebook C# Api Access Token
    Get Facebook C# Api Access Token
  • Getting Started With UDP Programming in Java
    Getting Started With UDP Programming in Java
  • Utilizing Config File In C#.NET Application
    Utilizing Config File In C#.NET Application
  • Generate HTTP Requests using c#
    Generate HTTP Requests using c#

Recent Posts

  • Building Auth With JWT – Part 2
  • Building Auth With JWT – Part 1
  • Document Your REST API Like A Pro
  • Understanding Golang Error Handling
  • Web Application Case Studies You Must Read

Tags

.net angularjs apache api audio auth authenticatin aws c# cloud server codeigniter deployment docker doctrine facebook git github golang htaccess html5 http javascript jwt linq mysql nodejs oop performance php phpmyadmin plugin process python regular expression scalability server smarty socket.io tfs tips unit-test utility web application wordpress wpf

Footer

Archives

Follow Us

  • Twitter
  • Facebook

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 3,774 other subscribers

Copyright © 2023