본문 바로가기

DEV/Git

(9)
Git 사용법 브랜치 생성 cd /workspace/project1 git log --oneline #커밋 로그 보기 git branch #현재 브랜치 확인 git branch project1 #새로운 브랜치 생성 git branch #현재 브랜치 확인 git log --oneline --all #변경된 브랜치 확인 브랜치 체크아웃 git checkout project1 #브랜치 체크아웃 git branch #현재 브랜치 확인 빨리감기(fast-forward)병합 git status #파일 변경후 스테이지 확인 git add file1.java #스테이지에 추가 git commit #커밋 추가 git log --oneline --all --graph #커밋 로그 보기 git checkout master #마스터 브랜치..
Git CLI 정리 1. init : Git 로컬저장소 생성 로컬저장소를 생성할 폴더에서 git init하면 .git(로컬저장소) 생성 2. config : 버전 관리를 위해 내정보 등록 (GitHub와 동일하게) git config --global user.email "kbs8971@daum.net" git config --global user.name "kbs8971" git config --global : 옵션 내용 확인 git config --global : 옵션 설정 git config --global --unset : 옵션 삭제 git config --list : 모든 옵션 확인 3. add : 파일을 스테이지에 추가 git add test.txt git add test1.txt test2.txt 4. commi..
Git 파일 제외 1. 해당 프로젝트명으로 이동 cd D:\dev\workspace\프로젝트명 2. .gitignore 파일 생성후 제외할 패턴작성 후 저장 *.com *.class *.dll *.exe *.o *.so 3. remove git rm -r --cached . 4. add git add . 5. commit git commit -m "add .gitignore" 6. push git push origin master
GitHub Desktop 사용법 1. GitHub Desktop 설치 https://desktop.github.com/ 2. GitHub에서 repository 복제 3. GitHub repository에 저장 - 소스가 변경되면 changed files 목록에 표시 - 왼쪽 하단에 설명적고 Commit to master 클릭 - 오른쪽 상단에 Fetch origin으로 push
Remote Repository 다른 사용자 초대 및 Clone 1. 사용자 초대 - Settings > Manage access > invite a collaborator 2. Remote Repository 연결 - git clone https://github.com/kbs8971/instaClone.git - git pull origin master (git fetch에서 하는 원격저장소의 변경사항을 가져와서 지역 브랜치에 합치는 작업)
GitHub Repository 생성 1. https://github.com/ 로그인 2. Repository 생성 3. git Remote - git remote add origin https://github.com/kbs8971/instaClone.git 콘솔에서 명령어 실행 - git remote -v (추가한 원격저장소의 목록 확인) - git remote show origin (특정 원격 저장소의 정보를 확인) - git remote rm origin (origin 원격저장소를 제거) 4. git push - git push -u origin master
Git 설치 및 Local Repository 생성 1. https://git-scm.com/ 접속 2. git 버전확인 git --version 3. 사용자 등록(한번 커밋한 후에는 정보 변경 불가) - 프로젝트마다 다른 이름과 이메일 주소를 사용하고 싶으면 --global 옵션을 빼고 명령을 실행 git config --global user.name "kbs" git config --global user.email "kbs@daum.net" 4. 사용자 등록 확인 git config --list 5. Local Repository 생성 git init 6. 현재 설정정보 조회 git config --global --list 7. 파일 상태 확인 (현재 작업중인 branch 알수 있음) git status 8. git add git add kbs.txt..
Git 회원가입 1. Git 회원가입 https://github.com/