■ 초기 Setting
git clone https://github.com/Whatmam/InCu6Q.git
git add Filesystem
git commit -m "ADD QT5"
git branch -M main
git push -u origin main


■ 리모트 저장소 확인하기
git remote -v

■ Branch 이동
git checkout (branch name)
git checkout develop            -> develop해서 사용하고 commit.. 후 master에게 merge 요청하여 사용이 좋음
git branch ->현재 branch 확인


※ repository의 branch , git clone에서 생성한 branch는 다르다. working repo -> remote repo로 적용시켜야함.

 

참고:  https://goddaehee.tistory.com/274

 - branch 생성
git branch test
 - branch로 이동
git checkout test
 - branch 생성 + 이동
git branch -b test
 - 생성한 Branch를 원격 Repository에 push 하기
git push --set-upstream origin test


■ Update
git pull ->현재 branch의 최신 업데이트
git pull origin (branch name) -> branch에 대한 업데이트


■ 수정 사항 확인 하기
git diff

■ push한 message 수정
1. git commit --amend
2. 수정
3. git push --force

■push 취소
git reset [체크섬]
git commit 
git push orign main -f (강제 push)

■push전 commit 돌리기
git log로 commit 체크섬 확인
git reset [체크섬]

■git tag로 download 
1. git clone -b upstream/6.2.4.p4.0 https://github.com/Freescale/kernel-module-imx-gpu-viv.git

2. git clone https://github.com/Freescale/kernel-module-imx-gpu-viv.git
git checkout upstream/6.2.4.p4.0

X git pull https://github.com/Freescale/kernel-module-imx-gpu-viv.git upstream/6.2.4.p4.0 이건 아님 최신에서 pull 하기에 이미 적용되어 있어서 안됨.

3. git clone https://github.com/Freescale/kernel-module-imx-gpu-viv.git
git reset --hard upstream/6.2.4.p4.0 reset으로 간다.

 

■ git tag

 - 테그 생성
git tag v1.0.0
git tag
git show v1.0.0

 - 원격 저장소의 테그 올리기
git push origin v1.0.0

 - 원격 저장소의 테그 삭제
git push origin :v1.0.0

 

 

■ project 히스토리까지 모두 복사하는 방법
git clone --mirror  git clone https://chs0517@106.251.230.25:28443/r/apps/test.git
cd sw_cowork.git/
git remote set-url --push origin http://106.251.230.24:9988/whatmam/test.git
git push --mirror 


■ error 시 

git config --global --unset http.proxy
git config --global http.sslVerify false

 

 -- git reset 하는법

https://sehajyang.github.io/tip/2019/03/11/git-reset-push.html/

'Git' 카테고리의 다른 글

Git commit push 내용 변경  (0) 2022.04.29
Git repository 옮기기 및 통합 Git repository (history 유지)  (0) 2021.11.08

+ Recent posts