본문 바로가기
728x90
반응형

Git21

Git의 원리] 2. git commit (tree, commit) 1. Staging Area에 add한 파일을 commit 해보자 $ git status On branch master Changes to be committed: (use "git restore --staged ..." to unstage) new file: f1.txt new file: f2.txt new file: f3.txt $ git commit -m 'first commit!' [master bbaa106] first commit! 3 files changed, 3 insertions(+) create mode 100644 f1.txt create mode 100644 f2.txt create mode 100644 f3.txt $ git log commit bbaa10614a8afcb2e938.. 2022. 8. 25.
Git의 원리] 1. git add (index, object, blob) 1. 테스트 프로젝트 생성 git을 test할 폴더를 선택하고 git init을 하여 git을 사용할 수 있도록 한다. 폴더 하위에 .git directory가 생성된다. object directory : all the content of your database refs directory : pointers into commit objects in that data (branches) HEAD file : 현재 check out된 branch git add시 생성되는 Index file : staging area information 2. 프로젝트 폴더에 'a'를 입력한 f1.txt 파일을 저장해보자. 3. f1.txt 파일을 git add하자. $ git add f1.txt .git\objects 경.. 2022. 8. 24.
GitLab CI/CD] 2. Job(.gitlab-ci.yml) 등록하여 실행하기 1. .gitlab-ci.yml 파일 생성 Project > CI/CD > Editor > 원하는 branch 선택 > Create new CI/CD pipeline 클릭! Edit 화면에 아래와 같이 설정하고 Commit changes 클릭 test-job: # 임의로 지정한 JOB 이름 stage: test only: - test script: - echo "Hello World" # 실행할 스크립트 tags: - helloworld stage : test, build, deploy only : branch before_script : script실행전 작업 script : job script after_script : script실행후 작업 tags : runner tag 2. Job 실행결과 확인.. 2022. 8. 24.
GitLab CI/CD] 1. GitLab Runner 설치 등록하기 Classic ASP를 사용하는 경우, EditPlus에 FTP설정하여 테스트서버의 ASP파일에 직접 접속하여 수정하는 경우가 있다. 로컬에서 수정하고, GitLab에 deploy시, 테스트서버에 자동 배포되도록 GitLab CI/CD를 설정해보자. GitLab CI/CD를 사용하기 위해서는, 소스 프로젝트에 runner가 등록되어 있어야 한다. GitLab Runner란? GitLab CI/CD에서 발생하는 Job을 실행하는 Agent 1. 사내 GitLab 서버(Linux Centos)에 GitLab Runner를 설치 # gitlab-runner 설치파일 다운로드 sudo curl -L --output /usr/local/bin/gitlab-runner https://gitlab-runner -do.. 2022. 8. 24.
SSH 작동 원리, 암호화 기술 SSH란? Secure Shell Protocol, 사용자가 원격 서버에 접속할 수 있도록 허용해주는 remote administration protocol이다. SSH 작동원리 SSH명령어는 3부분으로 구성된다. ssh {user}@{host} SSH key 명령어는 시스템에 encrypted Secure Shell Connection을 open하고 싶다고 지시한다. {user}는 접근하고자 하는 계정이다. system administrator와 동일한 권한을 사용하려면 root user로 접근할 수 있다. {host}는 접근하고자 하는 server이다. IP Address 또는 domain name일 수 있다. enter를 치면, 계정의 password를 확인하는 prompt가 뜬다. Encrypti.. 2022. 8. 11.
Git 개념 이해하기 1. The perfect commit! 1-1. Add the right changes! local changes를 하나의 commit으로 다 집어넣는 것 보다는, 하나의 주제에 대한 변경사항은 하나의 commit으로 처리하는 것이 좋다. 따라서 commit하고자 하는 topic에 맞는 file을 선별하는 것이 중요하다. Git statging area는 특정 파일들을 선택하여 commit할 수 있도록 한다. 하나의 파일을 부분별로 commit할 수도 있다. $ git add -p index.html then select hunk to stage 1-2. Compose a good commit message! Subject(간략하게) 와 Body(자세하게)로 작성할 수 있다. 2. Branching S.. 2022. 6. 22.
728x90
반응형