Skip to content

Instantly share code, notes, and snippets.

@hyunjun
Last active November 10, 2022 06:01
Show Gist options
  • Save hyunjun/5b3124a6110d5198e8cc to your computer and use it in GitHub Desktop.
Save hyunjun/5b3124a6110d5198e8cc to your computer and use it in GitHub Desktop.
Git installation
  • 새 machine 설정 시

  • 기본 configuration

    git config --global user.name "hyunjun.chung"
    git config --global user.email "hyunjun.chung@gmail.com"
    git config --global core.precomposeunicode true
    git config --global core.quotepath false
    git config --global color.ui auto
    
    git config --global core.editor vim # commit할 때 editor 문제 발생시
    
  • multiple user

    • ssh key

      ssh-keygen -t ed25519 -C "hyunjun.chung@wantedlab.com"
      pbcopy < ~/.ssh/id_ed25519.pub
      
      ssh-keygen -t ed25519 -C "hyunjun.chung@gmail.com"
      # file에 /Users/hyunjunchung/.ssh/id_ed25519_personal 입력
      pbcopy < ~/.ssh/id_ed25519_personal.pub
      
      # ssh-keygen -t rsa
      # ssh-keygen -t rsa # personal인 경우 filename을 다르게 e.g. /Users/madup/.ssh/id_rsa_personal
      # cat ~/.ssh/id_rsa.pub | pbcopy          # 회사 github 등록
      # cat ~/.ssh/id_rsa_personal.pub | pbcopy # 개인 github에 등록
      
      • permission 문제 발생시 permissions 0644 for are too open Code Example
      • (2022.11.10) ssh key를 등록할 때 github에서 제대로 등록이 진행되지도 않고 그냥 멈춰있는 현상이 있었는데 일시적이었음
        • 대략 10분 후쯤 다시 정상 진행되긴 했는데, github이 더이상 안정적이진 않다는 게 확실히 느껴짐
    • ssh config

      ❯ vi ~/.ssh/config
      Host wanted
        IdentityFile ~/.ssh/id_ed25519
        #IdentityFile ~/.ssh/id_rsa
        HostName github.com
        User git
        Port 22
      
      Host personal
        IdentityFile ~/.ssh/id_ed25519_personal
        #IdentityFile ~/.ssh/id_rsa_personal
        HostName github.com
        User git
        Port 22
      
      
    • git identity

      git config --global --unset user.name
      git config --global --unset user.email
      git config --global user.useConfigOnly true
      git config --global user.company.name "hyunjun.chung"
      git config --global user.company.email "hyunjun.chung@wantedlab.com"
      git config --global user.personal.name "hyunjun.chung"
      git config --global user.personal.email "hyunjun.chung@gmail.com"
      git config --global alias.identity '! git config user.name "$(git config user.$1.name)"; git config user.email "$(git config user.$1.email)";:'
      
    • 각 repository 사용시

      # (해당 repository에서) git identity [company|personal]
      git clone git@wanted:wanteddev/server.git
      cd server
      git identity company
      
      git clone git@personal:hyunjun/practice.git
      cd practice
      git identity personal
      
  • Getting-Started-Installing-Git

  • Redhat 7.2

    # get tar ball from sourceforge link in http://www.methods.co.nz/asciidoc/INSTALL.html
    $ tar xfz asciidoc-8.6.9.tar.gz
    $ cd asciidoc-8.6.9/
    $ ./configure
    $ sudo make install
    
    # then follow the steps in Redhat 6.6 except asciidoc
    # used https://www.kernel.org/pub/software/scm/git/git-2.7.2.tar.gz
    
  • Redhat 6.6 / Redhat 7.3 + git 2.13.1

    # cat /etc/redhat-release
    CentOS release 6.6 (Final)
    # yum install curl-devel expat-devel gettext-devel openssl-devel perl-devel zlib-devel
    # yum install asciidoc xmlto docbook2X
    # ln -s /usr/bin/db2x_docbook2texi /usr/bin/docbook2x-texi
    
    # 2.7.2 also works
    $ [https_proxy=http://x.y.z.w:port] wget https://www.kernel.org/pub/software/scm/git/git-2.6.2.tar.xz
    $ tar xf git-2.6.2.tar.xz
    $ cd git-2.6.2
    $ make configure
    $ ./configure --prefix=/usr
    $ make all doc info
    # make install install-doc install-html install-info
    $ git --version
    git version 2.6.2
    
    $ git config --global user.name "..."
    $ git config --global user.email "a@b.c"
    $ git config --global color.ui auto
    $ cat ~/.ssh/id_rsa.pub # register to profile
    $ git config -l
    
    • troubleshooting
      • error

        $ make all doc info
        ...
        imap-send.c: In function ‘setup_curl’:
        imap-send.c:1428: error: ‘CURLOPT_LOGIN_OPTIONS’ undeclared (first use in this function)
        imap-send.c:1428: error: (Each undeclared identifier is reported only once
        imap-send.c:1428: error: for each function it appears in.)
        make: *** [imap-send.o] Error 1
        
        • solution ./configure --prefix=/usr --with-curl=/path/to/curl ref
      • error xmlto: command not found # git 2.8.2 on redhat 6.3

        • solution yum install xmlto
      • error docbook2x-texi: command not found # git 2.8.2 on redhat 6.3

        • solution

          # yum --enablerepo=*epel* install docbook2X
          $ vi Documentation/Makefile
          ...
          DOCBOOK2X_TEXI = db2x_docbook2texi
          ...
          $ make all doc info
          
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment