If you are integrating GIT with RTC using nodejs on Ubuntu Operating System, the git push operation may fail with below error:
rcs@ubuntu14:~/Desktop/gitclientrepo/MyDemo$ sudo git push origin master
Username for 'http://***********:9999': rtc
Password for 'http://rtc@**********:9999':
Counting objects: 8, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (6/6), 477 bytes | 0 bytes/s, done.
Total 6 (delta 0), reused 0 (delta 0)
remote: hooks/pre-receive: 24: hooks/pre-receive:qs+=old_sha1=29b7606d44d0eafb5af3116e427e714425380c41&: not found
remote: hooks/pre-receive: 26: hooks/pre-receive: qs+=new_sha1=7926bb19a75e81afea807e7fa23f1aa99052d3cf&: not found
remote: hooks/pre-receive: 29: hooks/pre-receive: qs+=ref_name=refs%2Fheads%2Fmaster&: not found
remote: git-lib INFO getGitResourceProvider(): Could not find nodegit; reason={ [Error: Cannot find module '../build/Debug/nodegit'] code: 'MODULE_NOT_FOUND'}
remote: ValidatePush ERROR Domain Error: { [AssertionError: Invalid arguments main qs]
remote: name: 'AssertionError',
remote: actual: false,
remote: expected: true,
remote: operator: '==',
remote: message: 'Invalid arguments main qs',
remote: generatedMessage: false,
remote: domain:
remote: Domain {
remote: domain: null,
remote: _events: { error: [Function] },
remote: _eventsCount: 1,
remote: _maxListeners: undefined,
remote: members: [] },
remote: domainThrown: true }
remote: Invalid arguments main qs
remote: Utils VERBOSE exit(): ec = 1
To http://************:9999/git/MyDemo
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'http://********:9999/git/MyDemo'
Solution
The issue exists only for Ubuntu OS, as "sh" shell does not find nodegit because from Ubuntu 6.10, the default system shell, /bin/sh, was changed to dash
To make the integration working, we need to change the hooks scripts shell from bin/sh to /bin/bash.
Edit the pre-receive and post-receive hooks file and change the below entries:
#!/bin/sh
to
#!/bin/bash
Tags: 
ubuntu
nodejs
integrations
bash
ibm-iot
git
iot-support