davidkslack

Registered
Oct 14, 2012
2
0
1
cPanel Access Level
Root Administrator
Although I'm loving the step towards Git on WHM/cPanel being able to install via "Home »Software »Install an RPM", I just don't know what to do next!

I'd like to:
  1. Log into my WHM
  2. Create a new account on WHM .eg. example.com
  3. Add a link to my IDE for my new account e.g. [email protected]/example.git
  4. Me or my users Pull and Push from the new account / repository as we would BitBucket or GitHub using a password

I work on PC, Mac and Linux using PHPSorm, Aptana and a few other IDEs as a Web Developer.
I also work on shared computers and different IPs / networks.

I have a few WHM servers I would like to set this up on and would really like to know if this is possible and know how to set this up.

Any help to get started would be appreciated
Thanks
 

davidkslack

Registered
Oct 14, 2012
2
0
1
cPanel Access Level
Root Administrator
Hi Nick,

Thanks for getting back to me
I know Git is included with cPanel 11.36 or later as I say in the shout for help.

What I'd like to know is when I install Git on my WHM, how can I give access to my cPanel users to Push and Pull files to only their account?
And how do I allow my cPanel users to only create/add/delete/edit repos on their account?

Is there some sort of cPanel/WHM/Git help?
Has anyone been able to do anything like this?

Thanks
Dave.
 

CaMer0n

Well-Known Member
Nov 8, 2004
57
0
156
I see david, that we have the same wishes.
It would appear that it's not so easy to achieve what we want.

There are problems with the default cPanel git install it seems. (based on my tests with WHM 11.36.1 (build 5) )

1) The 'git' command is not automatically added to the $PATH environment during the upgrade.
2) Pushing to a repo over http/https will not be possible, because cPanel did not enable USE_CURL_MULTI while compiling git.

There may be other issues, but that is as far as I got before hitting that limitation.

If someone knows the commands to fix these issues, I may consider writing a WHM plugin to quick install a new git repo into a user's account.
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,233
363
cPanel Access Level
DataCenter Provider
Twitter
Is there an update on this, as i'd love to get Git setup on my WHM/cPanel server!
The "git" package is distributed with cPanel/WHM as of version 11.36. It's located at:

Code:
/usr/local/cpanel/3rdparty/bin/git
You will need to use the full path when calling to it.

Thank you.
 

JU5TY

Member
Nov 11, 2011
14
0
51
cPanel Access Level
Root Administrator
When I type in:

git -v

I just get the following:

git: command not found

I can navigate to /usr/local/cpanel/3rdparty/bin/git without a problem.

Any ideas?
 
Last edited:

gowrann

Member
Oct 23, 2011
15
0
51
cPanel Access Level
Website Owner
you'll have to add a path to your shell - can you get a response for:

/usr/local/cpanel/3rdparty/bin/git --version

And previously I made an error try

to see what git commands you can make
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,233
363
cPanel Access Level
DataCenter Provider
Twitter
Hello :)

Here is some output from the "help" command for "git":

The most commonly used git commands are:
add Add file contents to the index
bisect Find by binary search the change that introduced a bug
branch List, create, or delete branches
checkout Checkout a branch or paths to the working tree
clone Clone a repository into a new directory
commit Record changes to the repository
diff Show changes between commits, commit and working tree, etc
fetch Download objects and refs from another repository
grep Print lines matching a pattern
init Create an empty git repository or reinitialize an existing one
log Show commit logs
merge Join two or more development histories together
mv Move or rename a file, a directory, or a symlink
pull Fetch from and merge with another repository or a local branch
push Update remote refs along with associated objects
rebase Forward-port local commits to the updated upstream head
reset Reset current HEAD to the specified state
rm Remove files from the working tree and from the index
show Show various types of objects
status Show the working tree status
tag Create, list, delete or verify a tag object signed with GPG
There is an example on the following documentation page that may be useful to you:

https://help.github.com/articles/create-a-repo

Thank you.
 

ougogo

Well-Known Member
Dec 28, 2012
50
1
8
cPanel Access Level
Root Administrator
Thanks for your answer.

But how can I allow user to creat/delete git folder from cPanel ?
How can they manage git ?


Best regards
 

sp3ctre69

Well-Known Member
Aug 14, 2006
103
3
168
I see david, that we have the same wishes.
It would appear that it's not so easy to achieve what we want.

There are problems with the default cPanel git install it seems. (based on my tests with WHM 11.36.1 (build 5) )

1) The 'git' command is not automatically added to the $PATH environment during the upgrade.
2) Pushing to a repo over http/https will not be possible, because cPanel did not enable USE_CURL_MULTI while compiling git.

There may be other issues, but that is as far as I got before hitting that limitation.

If someone knows the commands to fix these issues, I may consider writing a WHM plugin to quick install a new git repo into a user's account.
Hi,

Is it still the case that it is impossible to push to a WHM git repo due to point 2? I don't want to spend too much time trying to get Git into my workflow if it's not going to work.

Thanks

Jim
 

cPanelToddR

Member
Staff member
Oct 8, 2009
21
1
128
Why do we have to use the full path? Seems cumbersome and unnecessary. How can we just allow users to type: 'git' instead?
The idea was that this gave the SA the option of deciding if they want to make a symlink in /usr/bin, /usr/local/bin, etc. or not.

Code:
ln -sf /usr/local/cpanel/3rdparty/bin/git /usr/bin/git
 

cPanelToddR

Member
Staff member
Oct 8, 2009
21
1
128
1) The 'git' command is not automatically added to the $PATH environment during the upgrade.
See above. This was done intentionally to stay out of the way of the OS. You can put a symlink in /usr/bin if you want people to have access to git.

2) Pushing to a repo over http/https will not be possible, because cPanel did not enable USE_CURL_MULTI while compiling git.
We believe this is a limitation of curl on CentOS 5. It works fine on CentOS 6 as best we can tell. Can you confirm the version of your distro?