티스토리 뷰

Study notes

[IT Study] Git, Github 복습

Fine Dust 2022. 11. 10. 11:13

Git : 코드를 관리하기 위한 소프트웨어이자 도구(형상관리 툴이라고도 불림). 컴퓨터에 Git이라는 소프트웨어를 설치하고 사용.

Github : 코드를 온라인에 저장할 수 있는 온라인(인터넷) 저장소

 

1. Git, Github, Sourcetree 주소

Git : https://git-scm.com/downloads 운영체제별 선택 다운로드 후 기본설치

 

Git - Downloads

Downloads macOS Windows Linux/Unix Older releases are available and the Git source repository is on GitHub. GUI Clients Git comes with built-in GUI tools (git-gui, gitk), but there are several third-party tools for users looking for a platform-specific exp

git-scm.com

Github : https://github.com 온라인 저장소

 

GitHub: Let’s build from here

GitHub is where over 83 million developers shape the future of software, together. Contribute to the open source community, manage your Git repositories, review code like a pro, track bugs and feat...

github.com

Sourcetree  : https://www.sourcetreeapp.com/      Git을 편리하게 사용할수있는 GUI 툴     

 

Sourcetree | Free Git GUI for Mac and Windows

A Git GUI that offers a visual representation of your repositories. Sourcetree is a free Git client for Windows and Mac.

www.sourcetreeapp.com

 

 

2. 기본 명령어

git init : 지금의 디렉토리 기준으로 git이 이 디렉터리르 관리 (최초 한번 실행)

git add    .  : 지금의 디렉토리를 기준으로 변경사항에 대해서 git이 추적 (add뒤에 경로(i.e, 마침표) 명시)

git commit : 커밋은 변경사항에 대한 작업을 확정

git remote add origin [git 주소]  : github 저장소 연결

git remote -v  :  github 저장소 확인

git branch : 브랜치 확인

git push origin master  : Github에 코드 올리기

 

3. branch 명령어

git branch : 현재 branch 확인

git branch creating-hello-file : creating-hello-file 브랜치 생성

git checkout creating-hello-file : branch 위치 변경(master 브랜치 -> creating-hello-file 브랜치)

 

4. merge 명령어

git checkout master : master 브랜치로 변경

git merge creating-hello-file : creating-hello-file 브랜치 병합

 

5. Merge 실패시 rebase 사용

- 충돌이 없는 경우

git checkout added-task2-printing

git rebase master

- 충돌이 있는 경우

git checkout added-task2-printing

git rebase master       충돌로 인해서 rebase 실패 -> 병합 작업 필요

- 코드 상에서 충돌 코드 직접 정리 수행

git add .

git rebase --continue

 

 

[인프런]  직접 활용할 수 있는 Git과 Github - 기초부터 협업까지 

 

[무료] 직접 활용할 수 있는 Git과 Github - 기초부터 협업까지 - 인프런 | 강의

강의에 목표는 협업, Git과 Github를 직접 다루시면서 협업까지 하실 수 있도록 학습을 해볼게요 :), - 강의 소개 | 인프런...

www.inflearn.com

 

 

 

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
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 29 30 31
글 보관함