CentOS7安装Git及代码的签入签出

在CentOS7环境下安装Git非常简单,根据以下步骤即可以在15分钟以内快速地搭建Git服务器,并掌握代码的签出以及签入。

  1. 确认是否已经安装Git
    rpm -qa git
  2. 安装Git
    yum install git
  3. 创建Git用户
    useradd [username]
    passwd [username],输入密码
  4. 创建Git代码仓库
    mkdir /data/git/[gitname]
    chown [username]:[username] [gitname]
    git init –bare [gitname]
    chown -R [username]:[username] [gitname]
  5. 克隆远程仓库
    cd /root/CLionProject
    git clone [username]@ip:/data/git/[gitname]
  6. 提交代码
    git add *
    git commit -m “your comment”
    git push origin master
  7. 提交Clion工程到Git代码仓库
    a. 菜单栏 VCS->Import into Version control-> Create Git Repository
    b. 右键工程,点击Git->Add
    c. 右键工程,点击Git->Repository->Remotes,在对话框中添加url
  8. 其他
    查看Git用户和邮箱
    git config user.name
    git config user.email
    修改Git用户和邮箱
    git config –global user.name [username]
    git config –global user.email [useremail]
    查看config属性
    git config –global –list
    删除config属性
    git config –global –unset user.name
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值