본문 바로가기
728x90
반응형

Git21

Git] Git bash에서 최근 커밋 Squash하기 squash는 Git command가 아니다. 다음 2가지 방법으로 commits을 squash할 수 있다. rebase 사용하기 : git rebase -i ...-squash option과 함께 merge하기 : git merge -squash시작하기 전에 Git alias slog를 만들자. $ git config --global alias.slog "log --graph --all --topo-order --pretty='format:%h %ai %s%d(%an)'"$ git slog* 7d737ab 2024-04-29 15:45:02 +0900 forth commit! (HEAD -> master)(test)* 16ddbd4 2024-04-29 13:39:04 +0900 third commit!.. 2024. 4. 30.
Git] alias Git 명령어를 전부 입력하는 것이 귀찮다면 git config를 사용하여 alias를 설정할 수 있다. $ git config --global alias.slog "log --graph --all --topo-order --pretty='format:%h %ai %s%d(%an)'" 기존 git log$ git logcommit 7d737ab2aa25cf0a3305a8fdbc3b14e7b2ebcab2 (HEAD -> master)Author: testDate: Mon Apr 29 15:45:02 2024 +0900 forth commit!commit 16ddbd4f35f0da695cee79695c6cf368d6358ccfAuthor: testDate: Mon Apr 29 13:39:04 2.. 2024. 4. 29.
Git] vim editor - Edit Multiple Line git bash 로 git squash를 하는 경우, 여러 commits를 하나로 합치기 위해서 라인별로 pick -> squash로 수정 후, 저장을 해야 한다.  라인별로 작업하지 않고, 한 번에 수정할 수 있도록 해보자. $ git logcommit 7d737ab2aa25cf0a3305a8fdbc3b14e7b2ebcab2 (HEAD -> master)Author: testDate: Mon Apr 29 15:45:02 2024 +0900 forth commit!commit 16ddbd4f35f0da695cee79695c6cf368d6358ccf (HEAD -> master)Author: testDate: Mon Apr 29 13:39:04 2024 +0900 third commit!.. 2024. 4. 29.
Git] The text is identical, but the files do not match! 서버에서 일괄 최신 소스를 다운받아 git commit 하려고 할때 변경파일이 많아서 확인해보니 아래와 같은 메시지를 확인하였다. The text is identical, but the files do not match! The following differences were founc: Newlines 해결방법 : $ git config --global core.autocrlf true # Configure Git to ensure line endings in files you checkout are correct for Windows. # For compatibility, line endings are converted to Unix style when you commit files. $ git ad.. 2023. 3. 22.
GitLab CI/CD] 4. rsync로 웹서버에 파일전송하기 3번글의 scp는 디렉토리 내 모든 파일을 복사하는 방법이다. 전체 소스 파일 중에서, 내가 수정한 일부 파일만 빠르게 전송하고 싶다면 rsync를 사용해보자. rsync사용법 rsync options source destination 1. 웹서버의 소스폴더를 가상디렉토리로 gitlab서버에 연결한다. 가상디렉토리 경로 : /testserver/testsite 2. 배포 시, rsync 스크립트 처리하기 include와 exclude 옵션을 이용해서 복사할 파일을 추가하거나 제외할 수 있다. backup디렉토리, gitlab-ci.yml, *.config파일을 제외한다. test-job: # 임의로 지정한 JOB 이름 stage: deploy only: - test #test branch에서만 실행됨 b.. 2022. 12. 30.
Git의 원리] 8. git tag 원리 tag를 생성할 때, git내부적으로 tag가 어떻게 관리되는지 확인해보자. # git 초기화한다. $ git init Initialized empty Git repository in C:/Project/git_test/.git/ # commit을 생성한다. $ vim f1.txt $ git add f1.txt warning: LF will be replaced by CRLF in f1.txt. The file will have its original line endings in your working directory $ git commit -m 1 [master (root-commit) d15d55a] 1 1 file changed, 1 insertion(+) create mode 100644 f1... 2022. 9. 8.
728x90
반응형