본문 바로가기

dev/git5

GitHub Actions를 이용한 자동 배포 파이프라인 구축 매번 코드를 수정하고 빌드 테스트를 하고,직접 서버에서 명령어를 치면서 배포를 하는데 직접 하다보니 매번 배포 절차도 동일하지 않고,, 코드를 수정해서 깃헙에 푸시한 다음부터는 자동으로 서비스 배포가 이루어지도록 CI/CD 파이프라인을 구축했다.CI/CD는 코드 변경 이후의 과정을 자동화하기 위한 개발 방식이다.CI (Continuous Integration, 지속적 통합)개발자가 코드를 GitHub에 푸시하면 자동으로 빌드와 테스트를 수행해 변경된 코드가 문제없이 동작하는지 검증하는 단계다.이를 통해 배포 전에 오류를 사전에 발견할 수 있다.문제가 없다면 main 브랜치에 합병하게끔 코드를 통합해서 관리를 할 수 있게끔 한다.CD(Continuous Deployment 또는 Continuous Deli.. 2026. 3. 22.
vscode repository 연결 vscode에서 프로젝트 생성 후 깃허브 레포지토리와 연동하려고 한다. 프로젝트 폴더경로에서 .git 파일을 생성하기 위해 아래 명령어를 실행한다. git init 원격 레포지토리와 연동한다. git remote add origin 레포지토리 주소 깃의 기본 브랜치가 master로 되어있으므로 깃허브의 main과 동일하게 바꿔줘야한다. git branch -M main 아래 명령어를 통해 깃 자체의 기본 브랜치 설정을 변경해주어도 된다. git config --global init.defaultBranch main 깃허브로 푸쉬 해준다. git push -u origin main 2023. 3. 26.
git clone 후 git hub에 push 가 안됨 git hub 에서 repository 생성 후 vscode에 복제를 했다. 코드 작업 후 커밋을 했는데 푸쉬가 안되서 git status를 확인하니 이러한 오류가 생겼다. 친절히 적혀있는 명령어를 입력하고 다시 브랜치 게시를 하니 정상적으로 푸쉬가 된다. $ git branch --unset-upstream 로컬에 origin 이 없어서 생기는 오류인거 같다. Why call git branch --unset-upstream to fixup? I'm more of a novice when it comes to advanced operations in git. I maintain my blog using the blogging framework Octopress. Though Octopress is no.. 2023. 2. 4.
깃 이슈 깃허브 풀을 했는데 에러가 났다. $ git pull hint: You have divergent branches and need to specify how to reconcile them. hint: You can do so by running one of the following commands sometime before hint: your next pull: hint: hint: git config pull.rebase false # merge hint: git config pull.rebase true # rebase hint: git config pull.ff only # fast-forward only hint: hint: You can replace "git config" with "git.. 2023. 1. 13.
깃 다루기.. 코드를 깃허브에 올리면서 정확히 깃 사용법을 알고 있지 않다. 잘못된 커밋을 하고 푸시를 하는 등의 상황이 빈번하게 일어날 것이기에 공부를 해야겠다. 깃 상태 확인 git status 코드 수정 전 On branch main Your branch is up to date with 'origin/main'. nothing to commit, working tree clean 코드 수정 후 $ git status On branch main Your branch is up to date with 'origin/main'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ...".. 2023. 1. 13.