0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Git 명령어 사용방법

Last updated at Posted at 2025-04-16

개요

git은 소스트리 또는 개발 툴에서 지원하는 깃 관련 툴에서도 간단하게 가능하기도 하지만, 안정성을 따진다면 git bash에서 직접 적는것만큼 안전한것이 없을것이다. 간편함에 안주해서 소중한 것을 잃기 무서워 몇가지 git관련 명령어를 남긴다.

브런치 체크아웃 관련

git checkout -b 브런치명  # 브랜치 생성 및 이동 

git checkout 브런치명    # 브랜치 이동 

깃 정보 확인

git status # 파일들이 스테이지에 있는지 아닌지에 대한 확인 

깃 원격저장소에 추가

git add 파일이름 # 파일을 스테이지에 추가 

git commit -m "커밋 텍스트" # 커밋 

git push origin 브런치명 # 푸쉬 

이 셋은 거의 셋트 비슷한 느낌이다. 묶어서 기억하자

풀 받기

git fetch # 원격 git(origin)에 있는 추가정보를 로컬git에 불러옴 

git pull origin 브런치명 # 풀

꼬이기 싫으면 왠만하면 git fetch 한 다음에 실시하도록 하자

깃 커밋 취소

reset --mixed  # commit과 스테이지 올리기 둘 다 취소。 

reset --soft   # commit만 취소하고 스테이지에 남기기。 

마치며

이것만 기억해도 깃 80%는 다 한거라고 생각한다.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?