본 글은 git hub 사용 시 자주 사용하는 용어를 정리해 놓은 것으로
너무 자주 사용해서 별도로 저장해놓는 용도입니다
git 사용하는 경우 config 설정에 대해 내용을 확인하거나 내용에 대한 변경이 필요할 시 사용하는 명령어임
git Desktop 경우 필요가 없지만 git console 사용 시 필요한 명령어임
잘못 user.name , user.email 입력 시 수정할 때 유용함
git config --list
다음 명령어 입력 시 현재 git 환경설정에 되어있는 주요 정보가 표시된다
저장소 , user.name , user.email 등등
1. git init ( 저장소 초기화)
2. git add Readme.md or * (해당 폴더 전체 저장소 추가) // 업로드할 해당 파일 지정
3. git commit -m "test" // 어떤 내용을 업로드하는지 기록
4. git branch -M main ( 브랜치 라인 지정 , 바로 push 해도 가능함)
5. git remote add orgin or git remote add origin https://github.io ...... (저장소 경로 추가 )
6. git push -u orgin main or git push ( 푸시)
중요한 user.name user.email 등 변경
-> 전역 설정 시 --global이라는 옵션을 사용
git config user.name "사용자 이름"
git config user.email "유저 이메일"
git config --global user.name "유저이름"
git config --global user.email "유저 이메일"
git config --unset user.name
git config --unset user.email
git config --unset --global user.name
git config --unset --global user.email
git config --unset-all user.name
git config --unset-all user.email
git config --unset-all --global user.name
git config --unset-all --global user.email
1. git remote -v # 현재 Local 연결된 원격저장소 확인
2. git remote remove [원격저장소 이름] # 연결 끊기
ex) : git remote remove origin
3. git remote add [원격저장소 이름] [원격저장소 url] # 다시 연결하기