zoukankan      html  css  js  c++  java
  • centos git gitolite安装笔记

    export PATH=/home/git/bin:$PATH

    echo PATH
    git branch 查看本地分支
    git branch -a 查看远程分支

    git fetch 获取远程分支

    git checkout -b <local_branch_name> 创建分支并切换

    git push origin <local_branch_name>:<remote_branch_name> 创建远程分支


    git checkout <local_branch_name> 分支并切换


    git branch -d <local_branch_name> 删除分支

    git clone -b src https://github.com/...

    git archive --remote=test:test.git HEAD:path/to/directory test.txt | tar -x

    git archive --remote=test:test.git HEAD test.txt

    git archive --remote=test:test.git HEAD:path/to/directory test.txt | tar -x

    git archive --remote=test:test.git HEAD test/test.txt | tar -x

    $ yum install git

    $ rm -rf /home/git 

    $ mkdir /home/git 
    $ useradd -d /home/git  git  
    $ passwd git
    $ chown -R git.git /home/git 


    $ su git

    $ cd ~

    $ git clone git://github.com/sitaramc/gitolite 

    $ mkdir -p /home/git/bin

    $ gitolite/install -ln /home/git/bin

    $ export PATH=/home/git/bin:$PATH
    $ echo $PATH

    ./bin/gitolite setup -pk ~/root.pub (注:root.pub存放位置git用户名~/.ssh)

    执行成功会示下面的初始化信息
    Initialized empty Git repository in /home/git/repositories/gitolite-admin.git/
    Initialized empty Git repository in /home/git/repositories/testing.git/

     SSH 的客户端配置文件 ~/.ssh/config 可以通过创建主机别名,在连接主机时,使用特定的公钥。
    例如 ~/.ssh/config 文件中的下列配置:
      host server
      user git
      hostname 192.168.1.212
      port 22
      identityfile ~/.ssh/root
  • 相关阅读:
    2018 ACM-ICPC 中国大学生程序设计竞赛暨丝绸之路程序设计竞赛
    牛客小白月赛2
    求n个数中前k个数,按之前的顺序输出(HK IPM)
    js_复选框单选与复选
    js_判断字符串中出现最多的字符的和次数
    js_倒计时
    海通证券面试
    上海利莫面试
    中焯信息面试
    富途面试
  • 原文地址:https://www.cnblogs.com/ytjjyy/p/3937093.html
Copyright © 2011-2022 走看看