CS/git
-
git reset git resetCS/git 2023. 6. 22. 19:18
도전하고 싶은것. 기존에는 무서워서 그냥 git reset hard 사용해서 커밋한 내용 삭제하고 내가 따로 메모했는데 이 커밋을 그대로 다른 이슈에 임시저장같이 사용하고 싶어졌다 1. 지금 git PUSH 한 걸 취소하고, UNSTAGED 상태로 돌린다. 지금은 git reset 사용. Unstaged 상태로 돌려야해서. ref : https://inpa.tistory.com/entry/GIT-⚡%EF%B8%8F-git-add-commit-push-취소하기-💯-정리-git-reset-restore-clean#git_reset_head_단계로_commit_취소 git reset {commit_id} 2. 새로운 이슈d 를 만든다음에 푸시한다. (임시저장) git checkout -b issue0000d ..
-
지금까지 통합 변동사항 알고 싶을때CS/git 2023. 5. 3. 13:16
지금까지 변동된 사항을 통합으로 확인하고 싶다면, 커밋내역을 하나씩 보는 방법도 있지만, 아래처럼 한번에 통합으로 변동된 사항보면 매우 편하다! git commit {커밋해쉬1} {커밋해쉬2} 이런식으로 해도 되지만 git commit {커밋해쉬1} HEAD 요런식으로 하면 원하는 지점부터 지금까지의 변경사항 확인가능! 혼용해도 작동가능 만약 브랜치간, 특정 파일의 변동사항만 알고 싶다면! git diff {branch1} {branch2} -- {file_path} REf: https://hajoung56.tistory.com/50
-
git pull remote branchCS/git 2023. 4. 17. 16:36
- 상황 : 1. 리모트 저장소에 branch A가 있고, 2. master branch는 이미 A가 만들어질 당시보다 update가 되어있음 3 . branch A가 없는 로컬 저장소에서 branch A를 이어서 작업하고 싶다. 4. 리모트 저장소에 있는 branch A를 그대로 가져오고 싶다면? 기존에 사용하던 master branch를 기준으로 branch A를 만든담에 git pull origin branchA는 머지 과정등이 필요해지게 된다. (2번떄문에) 1. 로컬에 연결된 리모트 저장소 업데이트 $git remote update 2. 원격 저장소 브랜치 확인 $git branch -r 3. 로컬+ 원격 저장소 브랜치 모두 확인 $git branch -a 로 가져올 브랜치 확인 4. 브랜치 가..
-
디렉토리 변경할때마다 git 초기화 필요CS/git 2022. 7. 7. 12:58
여태까지는 디렉토리마다 git 있는 경우도 있어 난잡해졌다..새로운 repo에 연결하거나, 디렉토리 변경할때 깔끔하게 git 초기화하는게 좋을 듯하다 1. git 삭제 $ rm -rf .git $ git remote -v fatal: Not a git repository (or any of the parent directories): .git $ git init -- 저장소 생성...(여태까지 git 초기화인줄;;;) Initialized empty Git repository in {~}/.git/ $ vim .gitignore 2. .gitignore 파일 #data *.csv *.ftr *.xlsx *.xls #img .jpg .png .jpeg ~ 3. git add 및 commit 4. git l..
-
[jenkins] git API key로 crendential 추가CS/git 2022. 7. 5. 14:39
1. github 전체 설정 (Settings) > Developer Settings > 권한 선택 > token 발급 2. Jenkins global option에서 Secret Text로 credential 추가 (Secret : token ID : github ID) 3. connect to API 하면 완료! 생각보다 간단.. 이 아니었음. global과 job 설정 credential이 다르니까 안되는데 ;; 그 이유를 찾아보고 싶다. --> 이문제가 아니라 ERROR: Error fetching remote repo 'origin' 이문제였는데 새로 빌드 파서 작업공간 초기화하니 실행되었음. 뭔가 꼬인거 같음. 아래 참조하여 해결 https://lookingfor.tistory.com/entr..
-
Git 새로운 remote repository 추가CS/git 2022. 6. 27. 11:26
1. 기존 repository 정리 - 다른 branch들 삭제 및 pull & push $ git branch -d develop2 $ git pull origin master $ git add . $ git status $ git commit -m "clean push" $ git push origin master 2. 기존 repository 삭제 $ git remote remove origin $ git remote -v 3. 원하는 directory 로 이동 $ cd {MY_DIR} 4. git init으로 초기화 $ git init Reinitialized existing Git repository in {MY_DIR} .git/ 5. 새로운 repository 연결 $ git remote a..