![[git]1.git명령어 모음](https://image.inblog.dev?url=https%3A%2F%2Finblog.ai%2Fapi%2Fog%3Ftitle%3D%255Bgit%255D1.git%25EB%25AA%2585%25EB%25A0%25B9%25EC%2596%25B4%2520%25EB%25AA%25A8%25EC%259D%258C%26logoUrl%3Dhttps%253A%252F%252Finblog.ai%252Finblog_logo.png%26blogTitle%3Dsson17&w=2048&q=75)
# 사용자 정보 설정
git config --global user.name "Your Name"
git config --global user.email son7571@github.com "you@example.com"
# 새 저장소 초기화
git init
git add . # 모든 변경된 파일 추가
# 변경사항 커밋
# 원격 저장소 추가 git remote add origin 주소
# 원격 저장소 목록 확인 git remote -v
# 원격 저장소에 변경사항 푸시 git push origin master
# 커밋 이력 확인 git log
원격저장소 변경
git remote set-url origin <새로운GITURL>
git status

바뀐 파일 표시
git clone 주소


git pull origin master

cd 파일경로 cd ..
파일 이동
git reset --hard 해시
해시 파일로 리셋
git reflog
Git의 로컬 히스토리를 조회

같은파일에 다른 해시를 가진파일을 업로드 하여 충돌남
이럴때는 2가지 방법
git push -f origin master
강제로 덮어쓰기
git pull -f origin master
강제로 파일 덮어씌우기
git log --oneline
깃허브에 올라간 파일 조회가능
git branch
브랜치 생성
git branch -d <로컬 브랜치 이름>
브런치 삭제
git checkout
브랜치 이동
git checkout -b
git checkout -- (변경사항있는파일링크)
해당 파일의 변경 사항 되돌리기
git merge (이동할 코드이름)
a -> (이동할 코드이름)
Share article