The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Git on WHM/cPanel

Discussion in 'General Discussion' started by davidkslack, Apr 14, 2013.

  1. davidkslack

    davidkslack Registered

    Joined:
    Oct 14, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    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. username@example.com/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
     
  2. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
    git is included with cPanel 11.36 or later.
     
  3. davidkslack

    davidkslack Registered

    Joined:
    Oct 14, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    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.
     
  4. CaMer0n

    CaMer0n Well-Known Member

    Joined:
    Nov 8, 2004
    Messages:
    59
    Likes Received:
    0
    Trophy Points:
    6
    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.
     
  5. JU5TY

    JU5TY Member

    Joined:
    Nov 11, 2011
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Is there an update on this, as i'd love to get Git setup on my WHM/cPanel server!
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  7. JU5TY

    JU5TY Member

    Joined:
    Nov 11, 2011
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thanks, how do I go about installing/using it on a cPanel setup?
     
  8. gowrann

    gowrann Member

    Joined:
    Oct 23, 2011
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    its on by default - at command line type
    for the version and
    to get started
     
    #8 gowrann, Jul 17, 2013
    Last edited: Jul 17, 2013
  9. JU5TY

    JU5TY Member

    Joined:
    Nov 11, 2011
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    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?
     
    #9 JU5TY, Jul 17, 2013
    Last edited: Jul 17, 2013
  10. gowrann

    gowrann Member

    Joined:
    Oct 23, 2011
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  11. JU5TY

    JU5TY Member

    Joined:
    Nov 11, 2011
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Okay great, thanks, that's working now.

    How do I install a new git repo into a user's account?
     
  12. ougogo

    ougogo Well-Known Member

    Joined:
    Dec 28, 2012
    Messages:
    50
    Likes Received:
    1
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    I want know too !

    Best regards,
    Hugo
     
  13. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

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

    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.
     
  14. ougogo

    ougogo Well-Known Member

    Joined:
    Dec 28, 2012
    Messages:
    50
    Likes Received:
    1
    Trophy Points:
    6
    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
     
  15. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  16. MACscr

    MACscr Well-Known Member

    Joined:
    Sep 30, 2003
    Messages:
    190
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Why do we have to use the full path? Seems cumbersome and unnecessary. How can we just allow users to type: 'git' instead?
     
  17. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You could setup an alias in the /etc/bashrc file. EX:

    Code:
    alias git="/usr/local/cpanel/3rdparty/bin/git"
    Thank you.
     
  18. sp3ctre69

    sp3ctre69 Well-Known Member

    Joined:
    Aug 14, 2006
    Messages:
    72
    Likes Received:
    0
    Trophy Points:
    6
    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
     
  19. cPanelToddR

    cPanelToddR Member
    Staff Member

    Joined:
    Oct 8, 2009
    Messages:
    21
    Likes Received:
    1
    Trophy Points:
    3
    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 
     
  20. cPanelToddR

    cPanelToddR Member
    Staff Member

    Joined:
    Oct 8, 2009
    Messages:
    21
    Likes Received:
    1
    Trophy Points:
    3
    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.

    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?
     
Loading...

Share This Page