Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 열 속성
- cache
- redis
- docker
- stream
- java
- static
- VUE
- 바이너리 카운팅
- 필드 주입
- 테스트 코드
- MSA
- 조합
- KEVISS
- equals
- jwt
- 재정의
- DI
- StringBuilder
- 인덱스
- hashcode
- Test
- DDL
- select_type
- AOP
- lambda
- jpa
- SQL
- 생성자 주입
- Spring
Archives
- Today
- Total
백엔드 개발자 블로그
Git 초반 설정 본문
💡 Git 초반 설정
1. Git setting
Git 다운로드 및 버전 확인
$ brew install git #brew를 이용한 git 다운
$ git --version #다운완료된 git 버전 확인
global 옵션 설정
- global 옵션을 설정하지 않는다면 해당 Git 프로젝트에서만 설정이 적용됨
$ git config --global user.name "lilly.11" #user.name 설정
$ git config --global user.email "lilly.11@kakaoenterprise.com" #user.email 설정
alias 명령어 사용
- 사용 편의를 위해 alias를 이용하여 간소화된 명령어를 입력함
- 아래 가이드에서는 alias 설정을 하지 않았다는 전제하에 설명됨 (가장 마지막 줄 log 예외)
$ git config --global alias.co checkout #checkout 명령어를 co로
$ git config --global alias.br branch #branch 명령어를 br로
$ git config --global alias.ci commit #commit 명령어를 ci로
$ git config --global alias.st status #status 명령어를 st로
$ git config --global alias.lg "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all" #log 출력 명령어를 lg로
설정 내용 확인
- 아래의 명령어를 사용하여 위에서 설정한 내용을 확인할 수 있으며, git config --help 명령어를 통해 명령어 도움말에 대한 정보를 확인할 수 있음
$ git config --list
2. GitHub에 코드 올리기
- init -> add -> commit -> push
$ mkdir git-exer #git-exer 디렉터리 생성
$ cd git-exer #git-exer 디렉터리로 이동
$ echo "깃 가이드 작성 테스트용입니다." >> README.md #텍스트 내용을 README.md에 삽입
$ git init #initialized - git 초기화
$ git add README.md #README.md 추가
$ git commit -m "initial commit" #"initial commit"으로 Commit
$ git remote add origin https://github.kakaocorp.com/lilly-11/git-exer.git #원격저장소와 연결
$ git push origin master #파일 올리기
3. GitHub에서 코드 받기
Repository clone
$ git clone https://github.kakaocorp.com/lilly-11/git-exer.git #git 원격저장소 clone
Repository push 권한
- 코드를 누구나 clone할 수 있지만, 권한이 없는 사용자는 push가 불가능하기 때문에 권한 확인 필요
$ echo "코드 기여" >> my.md #my.md 파일 작성
$ git add my.md
$ git commit -m 'ADD my.md'
$ git push
--> 권한이 없다면 불가능
'Git' 카테고리의 다른 글
Shared Model 협업 (0) | 2023.08.21 |
---|---|
되돌리기 (0) | 2023.08.21 |
Push_conflict (0) | 2023.08.21 |
CLI (0) | 2023.08.21 |
Git Lifecycle (0) | 2023.08.20 |