Git 사용 시나리오별로 해결 방법을 연구 합니다.  | 

$ git log --branches --graph --decorate --oneline  | 

  | 
 
 
 
 
  | 
 
  | 
$ git rebase -i HEAD~2 pick 004644d first commit 
 :wq  | 
  | 
  | 
  | 
  | 
  | 
  | 
## 설정된 정보 보기 $ git config --list http.sslbackend=openssl http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt diff.astextplain.textconv=astextplain core.autocrlf=true core.fscache=true core.symlinks=false user.name=Sanse user.email=sooabia@gmail.com core.editor="C:\Users\Sanse\AppData\Local\Programs\Microsoft VS Code\Code.exe" --waitfilter.lfs.process=git-lfs filter-process filter.lfs.required=true filter.lfs.clean=git-lfs clean -- %f filter.lfs.smudge=git-lfs smudge -- %f push.default=simple ## 설정/변경 하기 $ git config --global user.name "Sansae" $ git config --global user.email sooabia@gmail.com ## 삭제 하기 $git config --unset --global user.name $git config --unset --global user.email  | 
## 방금전 Commit한 메세지 수정
$ git commit --amend -m "{변경할 메시지}"
## 과거 Commit한 메세지 수정 (예: CommitID-3만 수정)
$ git log
CommitID-5
CommitID-4
CommitID-3
CommitID-2
CommitID-1
$ git rebase -i {CommitID-3}
------ EDITER --------
pick CommitID-5
pick CommitID-4
pick CommitID-3
==> 
pick CommitID-5-message
pick CommitID-4-message
edit CommitID-3-message
------ //EDITER --------
# SAVE
# Git 설명이 아래와 같이 출력되요.
You can amend the commit now, with
  git commit --amend
Once you are satisfied with your changes, run
  git rebase --continue
$ git commit --amend
------ EDITER --------
CommitID-3-message --> {변경할 Commit 메세지}
------ //EDITER --------
# SAVE
$ git rebase --continue
Successfully rebased and updated refs/heads/develop. | 
## 방금 Commit한 Author 변경하기
$ git commit --amend --author="{변경할이름}<변경할이메일>"
## 과전에 Commit한 Author 변경하기 (예: CommitID-3의 Author수정)
$ git log
CommitID-5
CommitID-4
CommitID-3
CommitID-2
CommitID-1
$ git rebase -i {CommitID-3}
------ EDITER --------
pick CommitID-5
pick CommitID-4
pick CommitID-3
==> 
pick CommitID-5-message
pick CommitID-4-message
edit CommitID-3-message
------ //EDITER --------
# SAVE
# Git 설명이 아래와 같이 출력되요.
You can amend the commit now, with
  git commit --amend
Once you are satisfied with your changes, run
  git rebase --continue
$ git commit --amend --author="{변경할이름}<변경할이메일>"
$ git rebase --continue
Successfully rebased and updated refs/heads/develop. | 
$ git config (--global) credential.helper store $ git pull # password를 입력하면 저장됨.  | 
# 커밋 한개 $ git format-patch -1 <커밋해시> # 커밋 여러개 $ git format-patch <시작해시>..<끝해시> # Patch 파일 적용하기 $ git checkout <targetBranch> $ git apply <패치파일명>  | 
 |