Github 명령어

Reading time ~1 minute

GitHub

gitHub란 대표적인 무료 Git 저장소이다.

Git이란 분산 버전 관리 시스템을 말한다.
local repository(로컬 저장소)란 git init 명령어로 생성되는 디렉토리(폴더)를 말하며 commit, commit을 구성하는 객체, 스테이지가 모두 로컬 저장소에 저장된다.
remote repository(원격 저장소)란 로컬 저장소를 upload하는 곳을 말한다.
working tree(워크트리, 워킹 디렉토리, 작업 디렉토리)란 .git을 뺀 나머지 폴더들을 의미한다.


특징

  • 각 소스코드 저장소마다 Gollum이란 마크다운 기반 위키를 만들 수 있다.
  • GitHub는 SSH 와 https 프로토콜을 지원하며, 각각 다른 방식의 Remote git의 URL로 저장된다.
  • Public/Private repository를 지원한다. 접근 권한이 필요한 private repository인 경우 기본적으로 GitHub 계정과 Password를 입력해야 git pull/push가 가능하다.
  • 각 repository마다 홈페이지를 한 개씩 만들 수 있다.


명령어

초기 등록

git config --global user.email "이메일"
git config --global user.name "이름"


로컬 리포지토리 지정

git init


기본 정보 확인

git config --list


스테이지에 올리기

git add (파일명)


버전(commit) 확정

git commit -m "version 01"


상태 확인 branch = 어떤 branch인지. status = 어떤 branch인지,

git branch

git status

git checkout #######


remote

git remote add origin https://github.com/(유저네임)/(리포지토리).git


push

git push origin master


원격 리포지토리에서 복제(다운로드)

git clone https://github.com/(유저네임)/(리포지토리).git


원격 리포지토리의 변경 사항을 로컬로 동기화

git pull origin master


원격 리포지토리의 변경 사항을 로컬로 업데이트

git pull (원격 저장소 이름) (브렌치이름)

Gitpporter Privacy

Published on January 02, 2023

(PillSoGood) 지원

Published on November 20, 2022