-
자주쓰는 github 명령어 정리프로그래밍 2023. 2. 18. 14:26728x90반응형
자주 쓰는 github 명령어 정리
git config --global user.name ro****
git config --global user.email ****@****.com
# 저장소의 변경 사항 가져오기 + 자동 merge
git pull
# 변경된 파일 추가
git add README.md
# 변경된 파일들 저장소로 commit 하기
git commit -m "update README.md"
[master 4c07bfe] update README.md1 file changed, 2 insertions(+), 2 deletions(-)
# git status 확인 git status
On branch masterYour branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working directory clean
# commit 된 변경 사항들을 github 저장소로 push 한다. git push
Username for 'https://github.com': **Counting objects: 7, done.
Delta compression using up to 12 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 287 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local objects.To https://github.com/
5ef4664..4c07bfe master -> master
#conflict 가 생겼을 경우 merge tool 사용하기
git mergetool
예전 commit으로 돌리기
특정 시점의 코드 버전이 필요한 것이면
git checkout commit번호
현재 작업내용을 과거 이력으로 돌리려면
git revert commit번호
git checkout is used to switch between different branches or to check out a specific commit or file from the repository's history. It is also used to create a new branch from an existing one. When you run git checkout, you are updating the files in your working directory to match the state of the specified commit or branch.
git revert is used to undo a commit by creating a new commit that undoes the changes made in a previous commit. It is a safe way to undo changes because it does not erase any commits or change the repository's history. When you run git revert, a new commit is created that undoes the changes made in the specified commit. In summary, git checkout is used to switch between branches or check out a specific commit or file, while git revert is used to undo changes made in a previous commit.728x90반응형'프로그래밍' 카테고리의 다른 글
google sheet 내용 python으로 읽고 쓰기 (0) 2023.04.27 how to get rank of each user in firestore (0) 2023.04.02 워드프레스 라이트세일 wp-signup redirect 이슈 (https://53.**.**.**.xip.io/wp-signup.php?new=mydomain.com) (0) 2019.11.05 tmap api 길찾기 정보 사용하기 (0) 2018.06.11 flask 속도 개선 방법 (2) 2018.05.02