본문 바로가기

git

git 명령어 사용법

728x90
git 명령어
 git remote remove origin (기존 원격 저장소 삭제)
 git remote -v (원격 저장소 확인)
 git remote init () "Reinitialized existing Git repository in C:/Users/내컴퓨터/Desktop/Nest_JS/Dev_Backend/.git/"
 git status (로컬 저장소 올리기 전 staging area의 목록 )
 git add 파일이름 vs git add .
 만약) warning: in the working copy of '.eslintrc.js', LF will be replaced by CRLF the next time Git touches it 에러의 경우
 > git config --global core.autocrlf true.
 git commit -m "12.18 First Commit" (로컬 저장소에 커밋)
 git branch [브랜치 이름] master(분기해서 나오는 브랜치) 예)master > new브랜치
 git branch (브랜치가 main 또는 master에 위치하고 있는 지 확인: *master 초록색이 현재 브랜치를 가리키고 있음)
 git push origin master (origin 원격 저장소 이름을 가지고 있는 master 브랜치에 업데이트 하겠다. )
728x90