Both sides previous revisionPrevious revisionNext revision | Previous revision |
git [2016/05/13 16:47] – [Commit 내역 병합] ledyx | git [2021/02/07 03:15] (current) – external edit 127.0.0.1 |
---|
= Git = | = Git = |
| |
참고 | * 참고 |
https://git-scm.com/book/ko/v2 | |
https://backlogtool.com/git-guide/kr/ | https://git-scm.com/book/ko/v2 |
https://rogerdudler.github.io/git-guide/index.ko.html | https://backlogtool.com/git-guide/kr/ |
| https://rogerdudler.github.io/git-guide/index.ko.html |
| |
{{tag>Git 형상관리}} | {{tag>Git 형상관리}} |
<sxh bash> | <sxh bash> |
git add <FILE 이름> | git add <FILE 이름> |
| </sxh> |
| |
| ==== 모든 비어있는 디렉토리 추가 ==== |
| <sxh bash> |
| git clean -nd | sed s/'^Would remove '// | xargs -I{} touch "{}.keep" |
</sxh> | </sxh> |
| |
#<revision> | #<revision> |
## 이어서 "~ 혹은 ^"를 붙이면 개수만큼 되돌림. | ## 이어서 "~ 혹은 ^"를 붙이면 개수만큼 되돌림. |
| |
| #지정한 <revision>과 최근 Commit을 병합하여 새로운 Commit 생성. |
</sxh> | </sxh> |
| |
git commit --amend | git commit --amend |
</sxh> | </sxh> |
| |
| |
| == Untracking files 삭제 == |
| |
| <sxh bash> |
| git clean <option> [--dry-run] |
| |
| #<option> |
| ## -f : 파일만 |
| ## -fd : 파일 & 디렉토리 전부 |
| |
| #[--dry-run] : 모의 실행 |
| </sxh> |
| |
| |
| |
# URL 대신 로컬 저장소도 복제 가능! | # URL 대신 로컬 저장소도 복제 가능! |
</sxh> | </sxh> |
| |
| === 특정 Directory pull === |
| <sxh bash ; highlight:[4]> |
| // pull 대상 Directory 생성하고 |
| git init |
| git remote add -f origin URL |
| git config core.sparseCheckout true |
| echo "원하는 Directory 이름" > .git/info/sparse-checkout |
| git pull origin master |
| </sxh> |
| |
| |
| |
<code bash> | <code bash> |
# Shell path (64x 기준) | # Shell path (64x 기준) |
C:\Program Files\Git\bin\sh.exe --login -i | "C:\Program Files\Git\bin\sh.exe" -login -i |
</code> | </code> |