리눅스 Github 연동

이주현·2023년 12월 20일
0

Linux

목록 보기
6/6
  • git 기본 설정
git config --global user.name [이름]
git config --global user.mail [메일 주소]
  • 설정 확인
# local 설정
git config --list
# global 설정
git config --global --list
  • Github Access token 인증 (토큰 발급은 깃허브에서)
    git clone 또는 git push 명령 시, Password로 발급 받은 토큰 입력

  • ID, Password 다지 묻지 않게 하기

    • Git Credential/cache

      • 인증 정보를 일정 시간동안 git cache에 임시로 저장하여 묻지 않기(기본값 15분, 초단위)
      git config credential.helper cache
      git config credential.helper 'cache --timemout=3600'
      • 캐시 인증 정보 초기화
      git credential -cashe exit
    • Git Credential/store

      • 깃 인증 정보를 ~/.git-credentials에 반영구 저장
      git config credential.helper store
      • 깃 인증 정보 초기화
      git config --unset credential.helper
  • 기본 명령어

    • start a working area

      • clone
        Clone a repository into a new directory
        git clone [url]
      • init
        Create an empty Git repository or reinitialize an existing one
        git init
    • work on the current change

      • add
        Add file contents to the index
        git add .
        git add 파일명
      • mv
        Move or rename a file, a directory, or a symlink
      • restore
        Restore working tree files
      • rm
        Remove files from the working tree and from the index
        # add 되돌리기
        git rm --cached 파일명
    • examine the history and state

      • bisect
        Use binary search to find the commit that introduced a bug
      • diff
        Show changes between commits, commit and working tree, etc
        git diff HEAD origin/master
      • grep
        Print lines matching a pattern
      • log
        Show commit logs
        git log
      • show
        Show various types of objects
      • status
        Show the working tree status
        git status
    • grow, mark and tweak your common history

      • branch
        List, create, or delete branches
      • commit
        Record changes to the repository
        git commit -m "커밋메시지"
      • merge
        Join two or more development histories together
      • rebase
        Reapply commits on top of another base tip
      • reset
        Reset current HEAD to the specified state
      • switch
        Switch branches
      • tag
        Create, list, delete or verify a tag object signed with GPG
    • collaborate

      • fetch
        Download objects and refs from another repository
        git fetch origin
      • pull
        Fetch from and integrate with another repository or a local branch
        git pull <원격 저장소 명> <branch 명>
        git pull origin master
      • push
        Update remote refs along with associated objects
        git pust <원격저장소명> <branch 이름>
        git push origin master
profile
까먹고.. 또 까먹고... 휴..

0개의 댓글