This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 211451

Summary: Automatic Git Push after every Commit (Git Hooks)
Product: versioncontrol Reporter: naitsirch <naitsirch>
Component: GitAssignee: Ondrej Vrabec <ovrabec>
Status: CLOSED INVALID    
Severity: normal CC: dhanasekaran, ghull, git, markiewb, obrejla, selami
Priority: P3    
Version: 7.1.1   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description naitsirch 2012-04-19 13:29:37 UTC
In Git it is possible to create hooks. It is very helpful when you have a post-commit hook which pushs every commit to the remote. When I am using Git in cmd and commit something this is done automatically by Git. But when I do a commit with Netbeans either the hook is not executed or it doesn't work (maybe because of the username/password request?).

The best solution would be a configuration in the project properties which tells Netbeans to automatically execute a push after every commit.

This would be a great feature.
Comment 1 Ondrej Vrabec 2012-04-19 13:33:16 UTC
> But when I do a commit with Netbeans either the hook is not executed or it doesn't work
It does not work because we do not use commandline client but a pure java implementation of git client.
Comment 2 Ondrej Vrabec 2013-09-02 12:00:22 UTC
... or maybe a checkbox in the commit dialog
Comment 3 sskuce 2013-09-04 18:51:05 UTC
Is this basically the same thing as the bug at https://bugs.eclipse.org/bugs/show_bug.cgi?id=299315, or is NetBeans using another Git client?
Comment 4 Ondrej Vrabec 2013-09-04 18:58:00 UTC
(In reply to sskuce from comment #3)
> Is this basically the same thing as the bug at
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=299315, or is NetBeans using
> another Git client?
Yes. NetBeans uses the same client as Eclipse - JGit
Comment 5 markiewb 2013-09-05 19:28:53 UTC
FYI:
* eGit provides a separate button "Commit and Push".
* IDEA provides a button labeled "Commit" which acts like a dropdown. When the dropdown is opened then the actions "Commit and push", "Export as patch" are available.
Comment 6 Ondrej Vrabec 2015-01-07 08:39:15 UTC
*** Bug 249668 has been marked as a duplicate of this bug. ***
Comment 7 Ageinfo 2016-05-20 08:31:58 UTC
Any news? Need commit and push command please
Comment 8 markiewb 2016-05-21 10:39:48 UTC
(In reply to Ageinfo from comment #7)
> Any news? Need commit and push command please

Reverting back to original version 7.1.1.

@ageinfo: Do not change the version. It is the version, where the RFE first has been requested. Vote instead!
Comment 9 Ageinfo 2016-07-08 08:26:01 UTC
Ok 

And i can't delete my previos comment in link: https://netbeans.org/bugzilla/show_bug.cgi?id=249668#c2
Comment 10 tkellerer 2016-10-11 06:36:45 UTC
I find myself using TortoiseSVN instead of NetBeans just because it has a "Commit & Push". 

What makes this even harder in NetBeans is that the "Push to remote" is on the third (!) level of the context menu.
Comment 11 aner 2016-10-21 15:56:20 UTC
I usually customize the toolbar and add "Pull Current Branch" and "Push Current Branch" to it so they are more easily accessible.  But even having it easily accessible does not mean that I don't forget to push sometimes.
Comment 12 naitsirch 2017-01-19 16:53:21 UTC
How difficult would it be to execute the hooks just via `bash` (or as `bat`-file on Windows)? Just like Git's command line tool itself (see https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks).

I think this would be a more flexible way of solving this issue and gives us the whole power of `bash`/`bat`.

This behaviour maybe opt-in in the configuration (in Tools > Options > Team > Git).
Comment 13 Christian Lenz 2018-10-25 15:34:28 UTC
I will close it, because it will handled now at the JIRA board: https://issues.apache.org/jira/browse/NETBEANS-775. Please discuss it there for further information.