본문으로 바로가기

ubuntu git 설정 및 환경설정

category Git 2018. 3. 6. 23:02
728x90
반응형

ubuntu git 설정 및 환경설정

1. sudo apt-get install git-core
2. git default config
- git config --list => default config 확인
- git config --global user.name "이름" => 이름 설정
- git config --global user.email "이메일 주소" => 이메일 주소 설정
- git config --global color.ui "auto" => 소스 변환 시 쉽게 판별하기 위해 컬러 설정
- git config --global core.editor <편집기> => 원하는 편집기로 설정
3. mkdir git 새로운 폴더 생성
4. git init
5. vi test.txt
6. git add test.txt
7. git commit -m "commit message"
8. git remote add origin <원격 서버 주소>
9. git push origin master


기타

1. Git 2.0 이후부터 git push 기본 동작이 matching->simple로 바뀌었다.
- matching => 동일한 이름을 가진 모든 branch를 모두 push
- simple 현재 작업중인 branch만 push
실행 : git config --global push.default simple
2. git push만으로 자동으로 master로 merge하기 위해 => git branch --set-upstream master
3. ssh키 원격 서버에 등록
- key-gen해서 .ssh폴더 생성
- .ssh폴더에서 id_rsa.pub 파일의 내용을 원격서버에 추가한다.




반응형