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.

cPanel & Git version

Discussion in 'General Discussion' started by brianjking, May 12, 2015.

  1. brianjking

    brianjking Active Member

    Joined:
    Sep 15, 2009
    Messages:
    35
    Likes Received:
    1
    Trophy Points:
    6
    Location:
    Chicago, IL
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    I have a WHM/cPanel server running 11.48.4 (build 2) on CentOS 6.6 and have installed Git using the instructions provided in the cPanel/WHM documentation at https://documentation.cpanel.net/display/1148Docs/Git.


    Code:
    [root@lw ~]# git --version
    git version 1.7.1
    However, there is not any instruction on how to upgrade git to a new version.

    Please help!
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    You can actually uninstall the system version of git through YUM and simply utilize the version already included with cPanel:

    Code:
    -bash-3.2# /usr/local/cpanel/3rdparty/bin/git --version
    git version 2.2.0
    
    Note that you can't change the version that's included with cPanel. You have to manually install your own system version of git if you want to use a specific version.

    Thank you.
     
    brianjking likes this.
  3. brianjking

    brianjking Active Member

    Joined:
    Sep 15, 2009
    Messages:
    35
    Likes Received:
    1
    Trophy Points:
    6
    Location:
    Chicago, IL
    cPanel Access Level:
    Root Administrator
    Twitter:
    Thanks for the quick reply. I have two questions.

    1. To uninstall do I simply run
      Code:
      yum remove git
      
      ?
      • Once I remove the package I installed with Yum how do I set the PATH for git to work just by running
        Code:
        git
        as opposed to having to execute it from
        Code:
        /usr/local/cpanel/3rdparty/bin/git
     
  4. madmanmachines

    madmanmachines Well-Known Member

    Joined:
    Nov 28, 2014
    Messages:
    94
    Likes Received:
    3
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Hi,

    Yes, you may run `yum remove git' to uninstall. You can run the following to create a symbolic link to the cPanel git
    Code:
    ln -s /usr/local/cpanel/3rdparty/bin/git /usr/bin/git
     
    brianjking likes this.
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Yes, the previous post is accurate. Simply run "yum remove git" and setup the symbolic link to /usr/bin/git and /usr/local/bin/git.

    Thank you.
     
    brianjking likes this.
  6. brianjking

    brianjking Active Member

    Joined:
    Sep 15, 2009
    Messages:
    35
    Likes Received:
    1
    Trophy Points:
    6
    Location:
    Chicago, IL
    cPanel Access Level:
    Root Administrator
    Twitter:
    I've done this and now have an issue when I go to commit to an existing repo to my Bitbucket origin master. Any help?

    Code:
    [root@lw /home/REDACTED/www]# git push
    warning: push.default is unset; its implicit value has changed in
    Git 2.0 from 'matching' to 'simple'. To squelch this message
    and maintain the traditional behavior, use:
    
      git config --global push.default matching
    
    To squelch this message and adopt the new behavior now, use:
    
      git config --global push.default simple
    
    When push.default is set to 'matching', git will push local branches
    to the remote branches that already exist with the same name.
    
    Since Git 2.0, Git defaults to the more conservative 'simple'
    behavior, which only pushes the current branch to the corresponding
    remote branch that 'git pull' uses to update the current branch.
    
    See 'git help config' and search for 'push.default' for further information.
    (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
    'current' instead of 'simple' if you sometimes use older versions of Git)
    
    fatal: The current branch master has no upstream branch.
    To push the current branch and set the remote as upstream, use
    
        git push --set-upstream origin master
    
     
  7. madmanmachines

    madmanmachines Well-Known Member

    Joined:
    Nov 28, 2014
    Messages:
    94
    Likes Received:
    3
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    That doesn't really sound like an error technically, but a warning rather due to a change of defaults in versions; and certainly not specific to cPanel. From http://stackoverflow.com/questions/...set-its-implicit-value-is-changing-in-git-2-0
     
  8. sonicthoughts

    sonicthoughts Well-Known Member

    Joined:
    Apr 4, 2011
    Messages:
    61
    Likes Received:
    3
    Trophy Points:
    8
Loading...

Share This Page