the murmurous sea

Git : 생활코딩 요약 본문

#dev/개념정리

Git : 생활코딩 요약

lunacer 2020. 5. 22. 21:02
git init  
git status  
git add (file)  
git commit  
git commit -m "message"  
git log  
git log --stat  
git diff  different, shows the differences between the last version and working tree
git log -p patch, shows the changes in the version
git checkout : navigate between the branches
git commit -am "message" add + commit with message at once
git commit :  shows a default editor to add multi lined message
git config --global core.editor "program"  how to change the editor
git reset --hard : reset the last version  
git reset --hard (version id)

reset and go back to the given ID version. Delete the version and working file. You won't be able to see the after versions anymore. (because of --hard) there's other options that can handle this in various ways. You should be very aware if you work as a team in this repository. 

--hard: delete all 
--soft: delete only the repository version. Back to before commit. 
--mixed: when don't add any option, it's default. Repository and stage is cleaned. Back to before add.
git revert revert the given ID version's change (not the entire versions after this, only the version's). If there's after versions, git will throw a conflict. Revert leave a log - means it creates a new version.
.gitignore fires to ignore to git
cat (file) check the content of the file in cmd

 


opentutorials.org/course/3839

 

Git CLI - 버전관리 - 생활코딩

수업소개 소위 git이라고 하면 command line에서 사용되는 프로그램을 말합니다. 이 수업에서는 바로 이 프로그램의 사용법을 살펴봅니다.    수업대상 이 수업은 아래와 같은 상황에 있는 분들을

opentutorials.org

www.devpools.kr/2017/01/31/%EA%B0%9C%EB%B0%9C%EB%B0%94%EB%B3%B4%EB%93%A4-1%ED%99%94-git-back-to-the-future/

 

개발바보들 1화 - git "Back to the Future"

  이 내용에 대한 자세한 기술적인 설명이 듣고 싶나요? 연속되는 다음글을 참조하세요    

www.devpools.kr

www.devpools.kr/2017/02/05/%EC%B4%88%EB%B3%B4%EC%9A%A9-git-%EB%90%98%EB%8F%8C%EB%A6%AC%EA%B8%B0-reset-revert/

 

[초보용] Git 되돌리기( Reset, Revert )

개발바보들 1화 git “back to the future”에서 설명한 Reset / Revert에 대한 글입니다.   Git을 익히면서 헷갈렸던 것들 중의 하나가 이력을 되돌리기 입니다. Git에서 이력을 되돌리는 방법은 여러가지��

www.devpools.kr

 

[branch and conflict]

mkdir (name): create a new directory
ls -al: shows all files in the current 
rm (file):delete the file


git log --all --graph --oneline
directory
git branch : shows the branches
git branch (name) : create a new (name) branch
git checkout (name) : move the head to the (name) branch
git commit --amend : to change the commit message
git merge (branch name) : head should be located the major brach which is the target branch is going to be merged.

 

[extra - good to know]

3way mergitool: P4Merge
git mergitool : start a mergetool
git workflow

 

https://opentutorials.org/course/3840


opentutorials.org/course/3843/24444

git remote add origin(it's nickname) (address)
git push -u origin master : link the master of local repo & remote repo
git fetch : update the remote repository. your head could be behind of the remote branch.
git merge origin/master: merge my local and remote branches.
git fetch; git merge FETCH_HEAD (or origin/master) = git pull
   : use fetch when you want to delay to merge
FETCH_HEAD : the latest fetched version
-----------------

git format-patch (original ver.)

[Code review program]
Gerrit
=============================

- Should use rebase on your local repository only. DO NOT use it after push

- the result of rebase must be the same from the result of merge m2 + t2 a file version is the same for after and before rebase, but the working copy is different.

working copy: before staging index(or staging area) : after adding the working copy to the stage merge vs rebase

https://opentutorials.org/course/3843/24444

mergetool : beyond compare (not free)

=========================

rebase conflict

git am --show-current-patch : to check the rebase conflicted patch

 

 

 

git Base?
reset 타켓 버전 이후는 사라짐
revert 되돌리려는 버전
merge 공통 부모
cherry-pick 체리픽한 버전의 전 버전 (부모)
rebase 공통부모부터 시작해서 하나씩 더해 나감

 

 

[quote]
Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away 
- Antoine de Saint-Exupery

 

//c75af42f8d81ff9cf01fa7ba980e0b62d5d76bda

'#dev > 개념정리' 카테고리의 다른 글

JS ES6: Functions hoisting check  (0) 2020.06.03
JS: Literal (incompleted)  (0) 2020.05.27
Progressive Web App (PWA)  (0) 2020.05.22
pjax  (0) 2020.05.21
SPA(Single Page Application)  (0) 2020.05.21
Comments