기본 사용 명령어 정리

ASHAPPYASIKNOW·2022년 10월 1일
0

GIT/GITHUB

목록 보기
3/3
post-thumbnail

명령어 설명


git log

git log

git lg

  • sourcetree 같은 툴을 사용하지 않고 log를 볼 때 매우 유용함

git alias 등록

git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an> %Creset' --abbrev-commit"

~/.gitconfig 등록 확인

vim ~/.gitconfig

git lg 동작 확인

git lg


url 등록 (https://github.com -> https://${PAT}:x-oauth-basic@github.com)

명령어

git config --global url."https://${PRIVATE-ACCESS-TOKEN}:x-oauth-basic@github.com/ashappyasitis".insteadOf "https://github.com/ashappyasitis"

~/.gitconfig 등록 확인

vim ~/.gitconfig


git remote

remote repository 확인

git remote -v

> git remote -v
origin  https://github.com/ashappyasitis/my-api.git (fetch)
origin  https://github.com/ashappyasitis/my-api.git (push)

remote repository 등록

git remote add kev https://github.com/ashappyasitis/my-new-api.git

> git remote -v
origin  https://github.com/ashappyasitis/my-api.git (fetch)
origin  https://github.com/ashappyasitis/my-api.git (push)
kev  https://github.com/ashappyasitis/my-new-api.git (fetch)
kev  https://github.com/ashappyasitis/my-new-api.git (push)

remote repository 삭제

git remote rm kev

> git remote -v
origin  https://github.com/ashappyasitis/my-api.git (fetch)
origin  https://github.com/ashappyasitis/my-api.git (push)

checkout

checkout

  • 브랜치를 변경하고 마지막에 저장되어있는 스냅샷을 불러온다.

git checkout master

브랜치 생성과 동시에 checkout하기

  • -b: branch를 생성해 주는 옵션

git checkout -b feature/make-some-new-api


FREE TOOLS FOR GIT/GITHUB

SOURCETREE

  • Windows와 Mac 둘다 지원

GIT FORK

  • Windows와 Mac 둘다 지원
  • 직관적
profile
36.9 It's good time to start something new

0개의 댓글