본문 바로가기

기타/Git8

Git branch 병합하기 현재 상태 exp 브런치는 버전 3,4를 가지고 있고 main은 5까지 되어있다. * commit 711f85eda1b73d691cff78ab5e810b34c5628931 (HEAD -> main) | Author: jungmin.park | Date: Thu Nov 2 09:34:22 2023 +0900 | | 5 | | * commit 3e33a79f7229f9d1380efb12876bfa66c9258791 (exp) | | Author: jungmin.park | | Date: Thu Nov 2 09:33:16 2023 +0900 | | | | 4 | | | * commit 54d7d726dceefd4628c9b2ac77d06eb3ffa22e8f |/ Author: jungmin.park | Dat.. 2023. 11. 2.
Git branch/log 옵션 시작하기전 셋팅 Desktop > git > gitfth3에서 작업을 진행 (base) bagjeongmin@bagjeongmin-ui-MacBookAir git % mkdir gitfth3 (base) bagjeongmin@bagjeongmin-ui-MacBookAir git % ls -al total 24 drwxr-xr-x 6 bagjeongmin staff 192 10 28 13:14 . drwx------@ 24 bagjeongmin staff 768 10 27 09:07 .. -rw-r--r--@ 1 bagjeongmin staff 8196 10 28 11:37 .DS_Store drwxr-xr-x 5 bagjeongmin staff 160 10 27 09:47 gitfth drwxr-xr-x.. 2023. 10. 28.
Git log 옵션/reset/commit 옵션 log -p (버전에 대해 파악) log -p 옵션을 사용하면 버전간의 차이점과 과거 어느시점의 내용을 파악할 수 있다. 각각의 커밋과 커밋사이 소스상의 차이점을 알 수 있다. commit 96f4ef4bc9d69df35bdd54c1529680eba9fc61b2 (HEAD -> master) Author: jeongmin Date: Tue Dec 27 13:57:17 2022 +0900 4 diff --git a/f2.txt b/f2.txt index 2456b16..d170595 100644 --- a/f2.txt +++ b/f2.txt @@ -1 +1 @@ -source : 2 +source : 4 commit 5d6ec50fbacee1d06a4c2d7e67a7a516321ca53a Author: j.. 2023. 10. 27.
Git init/status/config/add/commit/log init(Git 저장소 생성) 현재 디렉토리에서 작업을 진행하겠다는 것을 알리는 명령어 -> 즉, 버전관리를 시작 .git 이 생성되는데 버전관리 정보를 담고있다. ( 삭제에 주의 ) f1.txt 파일을 만들어 source : 1 텍스트를 추가하고 저장했다. f1.txt source : 1 버전 : 작업의 단위, 작업이 완결된 상태 status( 파일 상태 확인하기 ) git status을 입력하게 되는 경우 다음과 같은 화면이 나옴 On branch master No commits yet Untracked files: (use "git add ..." to include in what will be committed) f1.txt nothing added to commit but untracked fi.. 2023. 10. 26.