티스토리 뷰

etc

git

kingsubin 2020. 12. 7. 10:30

https://www.youtube.com/channel/UC_4u-bXaba7yrRz_6x6kb_w

git --version

 

git config --list

설정 리스트 보기 

 

git config --global -e

편집환경으로 열기

 

git config -- global core.editor "code"

git config -- global core.editor "code --wait"

 

git config --global user.name ""

git config --global user.email ""

 

git config user.name

git config user.email

 

git config --global core.autocrlf input

윈도우는 true 맥은 input

 

git 명령어 -옵션

 

git init

ls -al : 숨긴거도보임 

ls : 숨기거는 안보임

rm -rf .git : 깃 제거

기본 branch는 master

 

git status

git config --global alias.st status 

-> stats를 st로 쓰고싶다

git st

 

git config --h 

-> config에 관한 속성들을 볼 수 있음

 

///

git workflow

 

local

 

working directory

(untracked , tracked (unmodified, modified))

 

staging area

.git directory

- push -> remote

 

//

git add a.txt

git add *.txt

git add * : 디렉토리 모든파일

git add . : 모든 파일들을 포함해서 

 

- add -> staging area

 

git rm --cached *

모든 파일을 staging area에서 제거 

 

// 

추가하고싶지않은 아이들

echo *.log > .gitignore

 

//

git status -h

옵션 확인

git status -s

간단하게 보기

git diff

 

// 

cmd + k : 터미널 깨끗하게

 

// 

git diff

git diff --staged 

git diff --cached

git diff -h

 

git config --global -e

[diff]

 tool = vscode

[difftool "vscode"]

 cmd = code --wait --diff $LOCAL $REMOTE

git difftool

git difftool -staged

 

//

git commit 

git log

 

git commit -m "seconde commit"

git commit -am "third commit" : 전부 다 

 

//

git commit 현재형, 동사형

커밋 메시지에 맞게 해당하는 내용만 맞게 커밋

너무 작게도 x 너무 크게도 x

 

////////

생활코딩 PR

 

master : 언제 실행하고 배포해도 문제없을때

topic branch :: 새로운 작업 실행할때 만들고 쓰다가 버릴수있어서 좋음

 

git checkout -b "branch name" 

 

 


나중에 다시 보기

jeonghwan-kim.github.io/dev/2020/02/10/git-usage.html

'etc' 카테고리의 다른 글

docker, redis  (0) 2021.02.09
mac 세팅  (0) 2021.01.19
react-springboot 연동  (0) 2021.01.16
wsl2 설치  (0) 2021.01.14
CORS, Proxy  (0) 2020.12.13