GitLab

GIT checkout

2022. 6. 21. 11:33
반응형

checkout

  • 작업 중인 branch switch & commit 전환
  • 수정 중인 내용 되돌리기 restore
git checkout -t {branch} //특정 브랜치로 이동 (new:-t / 기존:-b)  
git checkout .  //모든 변경 내용 되돌리기
git checkout {commit hash}  //특정 commit 버전으로 전환
반응형

'Infra > git' 카테고리의 다른 글

GIT add  (0) 2022.06.21
GIT cherry-pick  (0) 2022.06.21
GIT remote  (0) 2022.06.21
GIT status  (0) 2022.06.21
GIT pull  (0) 2022.06.21

GIT remote

2022. 6. 21. 11:25
반응형

remote

  • 작업 중인 local branch 연결된 저장소 확인
git remote -v
git remote remove origin //연결 삭제
git remote add origin {brach} //신규 연결
  • first local branch를 remote 로 push
git init
git remote add origin {git repository}
git add .
git commit -m "initial commit"
git push -u origin master
  • remote branch 잘못 올라간 파일 삭제
git rm --cached -r <file or folder>  //.gradle
git add .
git push origin master
반응형

'Infra > git' 카테고리의 다른 글

GIT cherry-pick  (0) 2022.06.21
GIT checkout  (0) 2022.06.21
GIT status  (0) 2022.06.21
GIT pull  (0) 2022.06.21
Git fetch  (0) 2022.06.21

GIT status

2022. 6. 21. 11:24
반응형

status

  • 작업 중인 local branch 변경 상태 확인
git status
반응형

'Infra > git' 카테고리의 다른 글

GIT checkout  (0) 2022.06.21
GIT remote  (0) 2022.06.21
GIT pull  (0) 2022.06.21
Git fetch  (0) 2022.06.21
GIT log  (0) 2022.06.21

GIT pull

2022. 6. 21. 11:23
반응형

pull

  • remote repository에 변경사항을 local repository로 fetch 후 merge
git pull
반응형

'Infra > git' 카테고리의 다른 글

GIT remote  (0) 2022.06.21
GIT status  (0) 2022.06.21
Git fetch  (0) 2022.06.21
GIT log  (0) 2022.06.21
GIT init  (0) 2022.06.21

Git fetch

2022. 6. 21. 11:22
반응형

fetch

  • remote repository에 변경사항을 local repository로 가져만 옴
git fetch
반응형

'Infra > git' 카테고리의 다른 글

GIT status  (0) 2022.06.21
GIT pull  (0) 2022.06.21
GIT log  (0) 2022.06.21
GIT init  (0) 2022.06.21
GIT 명령어  (0) 2022.04.07

+ Recent posts

반응형