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
  • 相关阅读:
    题解 UVA10213 【How Many Pieces of Land ?】
    NOIP 2018 游记
    POJ 1821 Fence(单调队列优化DP)
    HDU 2196 Computer(经典树形DP)
    POJ 2228 Naptime(DP+环形处理)
    POJ 1742 Coins(多重背包?)
    POJ 2311 Cutting Game(SG函数)
    BZOJ 2560(子集DP+容斥原理)
    HDU2841 Visible Trees(容斥原理)
    HDU 1796 How many integers can you find(容斥原理)
  • 原文地址:https://www.cnblogs.com/ytjjyy/p/3937093.html
Copyright © 2011-2022 走看看