Git Session | 실습 자료

younghyun·2022년 2월 5일
0

Linux 세션 때 만든 wecode 폴더로 이동

cd Desktop/wecode

wecode 폴더 안에 git_practice 폴더 생성

mkdir git_practice

Git 시작

  • git 초기화

    # git_practice으로 이동
    cd git_practice
    
    # git 초기화
    git init
  • .git 폴더 확인

    ls-al

본인영문이름.md 파일 생성

touch seunghyunson.md

해당 파일에서 본인 이름 작성 후 저장

  • vim 편집기 실행
    vi seunghyunson.md
  • insert 모드 전환 후 내용 작성 및 저장
  • git 상태 확인
    git status

Staging(중간 저장) : 파일 수정 이력 기록 준비

기록 준비하는 것. 장바구니 개념. 상품 결제하기 전에 장바구니 담는 개념.

git add
  • git status로 상태 변화 확인

Commit : 파일 수정 이력 기록

세이브 포인트. 장바구니 담은 코드들을 실제로 결제하는 것

git commit -m "메세지
  • git status로 상태 변화 확인

Git log : Commit history 확인.

어떤 내용을 수행을 한 세이브 포인트 인지 확인.

git log

Github repo 생성

  • github 사이트 → New repository

git_practice 폴더와 github repository 연동

git remote add origin repository주소

git remote - v : 연결된 저장소 확인

git push

git push origin main

profile
선명한 기억보다 흐릿한 메모

0개의 댓글