Gitコマンドの整理
Git用語集
원격저장소
(プレスリリース)Githubファシリティ(フォルダ)
로컬저장소
(自分の作業フォルダ)= working Directory
これは私のパソコンのGit管理バージョンのフォルダです.
Staging Area
git addコマンド実行時のリポジトリcommit
履歴を保持するバージョン管理動作、または生成されたファイルpush
実際のソース(コミット)をリモート・リポジトリにアップロードpull
実際のソース(コミット)をローカルリポジトリに書き込むgit config
git config --list or -l
:複数のconfig情報をリストに出力diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
http.sslbackend=openssl
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
core.autocrlf=true
core.fscache=true
core.symlinks=false
pull.rebase=false
credential.helper=manager-core
credential.https://dev.azure.com.usehttppath=true
init.defaultbranch=master
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
filter.lfs.clean=git-lfs clean -- %f
user.name=seonggon do
[email protected]
アカウントの設定# --global를 사용하여 전역으로 설정
git config --global user.name "USER_NAME"
git config --global user.email "USER_EMAIL"
# Repository마다 다른 사용자(계정) 정보 사용
git config --local user.name "USER_NAME"
git config --local user.email "USER_EMAIL"
アカウントの削除# global
git config --unset --global user.name
git config --unset --global user.email
# local
git config --unset user.name
git config --unset user.email
stash
スタックに新しいstashを作成するタスクを一時的に保存
git stash
:一時的に作業を保存すると同時に、このプロセスで作業ディレクトリの記憶がなくなります.git stash list
:stashリストの表示git stash apply
:stashの適用git stash drop
:「削除stash」リストから削除します.branch
git branch <브랜치 이름>
:ブランチの作成git branch [-a]
:ブランチに何があるかチェックgit branch -d {브랜치명}
:ブランチの削除git checkout <브랜치이름>
:指定したブランチに移動(편집중...)
git push origin <브랜치 이름>
git checkout master : master로 이동
git merge <브랜치 이름> : master에서 와 <브랜치>합병
Origin/Masterは、最初のリモート・リポジトリのmaster 브랜치
です.つまり、Originは最初のリモート・リポジトリです!
commit amend
git commit --amend
:前回コミットした変更コミットの追加インテリジェント化を使用すると、
簡単に処理できます!
confilct
異なるブランチがマージされて問題が発生する可能性があります.
1つのファイルでは、ブランチごとに異なるコードがあり、Gitは知らないので、衝突と呼ばれています!
ソリューション)
1)git branch master:masterに入る
2)(競合するファイル>>><<など)
全部拭いて、よく触って/ここでは長い時間がかかるかもしれませんが...--だから当初その人が担当していた部分は彼にしか担当させなかったはずだ.
3) git add .
git commit-m""を完了!
reset vs revert
git reset
:복귀
で、バージョンが返された後のすべてのバージョン(コミット履歴)が消えます.git revert
:취소 커밋
.バージョンを返すと、すべてのバージョンは変更されず、新しいコミットのみが追加されます.つまり、リストアされます.リセットはもっと危険!
git reset --hard <되돌릴 싶은 commit번호> // revert랑 다른 점!
hard/mixed/soft 협업할 때 reset하기 정말 까다롭다...
そして강제 push
を作ります!git push -f origin master
git revert <빼버리고 싶은 commit번호> // git log에서 commit번호 확인
git revert de6d5c1148981e15617999c7ecaa6ec2ea21ff29 --no-edit
また、衝突したくないなら逆順に!復元します.一度そのコミットに戻そうとすると、衝突します!ex.
Reference
この問題について(Gitコマンドの整理), 我々は、より多くの情報をここで見つけました https://velog.io/@mooh2jj/Git-정리テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol