Git
- 가장 대중적인 코드 관리 도구
- 목적 : 이력관리 (버전관리)
- 특징 : ‘분산’ 버전관리
Git Setting
1 | |
Git Status
1 | |
Staged File : Files requiring constant observation Commited File : Save current condition in Git Repo
- git status
- Version Control, Source Code Management
- When appears ‘Untracked file’. It means Git doesn’t know that file
- git add
- 1st alert ‘Changes to be commit’. It means Your file is in Staged Area
- 2nd alert ‘Changes not staged for commit’. It means You’ve got modified file on Tracked file, But not in Staged Area (Not Staged condition)
- git commit
- Source Control is Available since data was committed in Git Repository
- Enter when you want to SAVE
Git ignore
git mv file.rft file.gitignore
When you’ve got files you want to ignore, make a txt file and change file extention .rtf(.txt etc) to .gittgnore.
Git log - 기록
press ‘q’ when escape
1 | |
commit : Hash Code of your file Author : Author name <Author’s email> Date : Committed date
git log’s 4 command line
1 | |
Git checkout
Not a recommanded way git checkout 'hash[:6]' Keep returning purpose in mind
Branch
1 | |
when you checking out to master, files you made with another branch name will disappear
Merge
git merge name # branch name in the master branch
gitk - History with graph
gitk
Push
git push -u origin master Branch called master push to Remote server called origin
Remote
Create New Repository on terminal line git remote add origin https://www.github.com/~/~ remote Total command line of remote repository add Plus origin the name, the first https://~ same as HTML
Remote Command Line
git remote #Expected Result : origin git remote -v git remote add origin git remote add name git remote rm name # Delete
Commit in Git Remote server
1 | |
Remote server to Local
- Clone - Get everything
- Pull - Merge same branch
- Fetch - Only get changed things
(1) Fork & Pull Request
Fork🍴 - 타인의 Repo를 나의 github repo로 옮김 Pull Request - Fork로 가져온 타인의 코드 수정 후 반영을 요청함
1 | |
(2) Permission
permission Setting : 작업 권한을 공동 작업자에게 위임 github 내 setting 에서 추가