일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- github
- drug development
- pandas
- CSS
- scRNAseq analysis
- CUTandRUN
- ngs
- 싱글셀 분석
- js
- 비타민 C
- single cell
- HTML
- single cell analysis
- ChIPseq
- single cell rnaseq
- cellranger
- CUT&RUN
- javascript
- Git
- python matplotlib
- DataFrame
- drug muggers
- Batch effect
- Bioinformatics
- julia
- scRNAseq
- PYTHON
- MACS2
- EdgeR
- matplotlib
- Today
- Total
바이오 대표
[Git] Intro - Linux에서 파일 비교하기 (diff/patch) 본문
< diff/ patch >
해당 코드를 통해 old_version 과 new_version을 비교 및 확인 할 수 있다. (All changes, context 확인 가능)
사용 이유: 사람이 직접 비교하면 시간도 많이 많이 걸릴뿐더러 error-prone
=> automatically by using diff/patch
< diff >
$ diff [old_file] [new_file] # difference 찾기
해당 코드의 아웃풋으로, difference 가 있는 code line 만보여준다. 두개의 파일 비교 후 < 는 old_version, > 는 new_version에서의 라인들을 보여준다.
< line #from [old_file]
> line #from [new_file]
만약 output에 "5c5,6" 와 같이 표시가 된다면 이는 old_version의 5번째라인이 new_version 파일 5,6라인으로 바뀜을 보여준다.
https://man7.org/linux/man-pages/man1/diff.1.html
< diff - u >
$ diff -u [old_file] [new_file]
shows a unified format to show the difference ("-" removed, "+" added)
예를들어 output이 다음과 같을 때 old_version과 비교했을때 라인1은 추가된 라인이고 라인2는 삭제된 부분이다.
+ line1
- line2
$ diff -u [old_file] [new_file] > change.diff
* > (redirect changes into generate context)
*Difference 를 볼 수 있는 다른 commands
- wdiff (highlight words (not showing lines like diff)) , meld, KDiff3, vimdiff
< patch >
patch 코드를 이용해서 apply changes to the original file
$ patch [file] < change.diff
'Programming enviorment' 카테고리의 다른 글
[Git] Git 기본 사용법 (init, config, add, commit) (0) | 2021.11.25 |
---|---|
[Git] Git Install 설치하기 (0) | 2021.11.21 |
[Git] Intro - VCS (Version Control System) (0) | 2021.11.17 |
[ Jupyter Lab ] Window 환경에서 jupyter lab (cmd) (0) | 2021.09.26 |
[ Google Colab ] 런타임 연결 끊김 방지, 세션 유지 (3) | 2021.09.24 |