Push

GIT push

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

push

local repository에 commit 이력을 remote branch 로 보낼 경우 사용

git push origin {branch}
git push origin {branch} -f  // remote force push

최근 commit 이력을 취소하고 push(remote에 잘못된 commit 이력을 push 했을 경우)

git reset HEAD^ 
git push origin master -f

commit history 전부 삭제하고 초기 상태로 되돌릴 경우

rm -rf .git 
git init 
git add . 
git commit -m "feat(init): initial commit" 
git push origin master
반응형

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

GIT merge  (0) 2022.06.21
GIT rebase  (0) 2022.06.21
GIT commit  (0) 2022.06.21
GIT stash  (0) 2022.06.21
GIT clean  (0) 2022.06.21

+ Recent posts

반응형