본문 바로가기

git

(7)
git issue 사용법 new issue기존의 이슈가 있고 새로 생성하는 경우create new branch새로운 브랜치 생성생성된 이슈에 대해 관련 제목과 설명을 달아 주고 누구에서 할당할 것인지 결정하자자신에게도 할당할 수 있다바로 머지 리퀘스트를 만들지 말고 브랜치부터 생성하자새로운 브랜치가 생성된 것을 확인할 수 있다.checkout new branch해당 저장소를 클론을 받지 않았다면 클론을 받고 이미 클론을 받았다면 새로 pull을 받자새로운 브랜치가 생성된 것을 확인 할수 있다$ git pullFrom git.testdns.dev:jmjeong/sandbox * [new branch] 2-test -> origin/2-testAlready up to date.새로운 브랜치로 이동하자$ git che..
git ssh 키 생성 등록 ssh key 생성$ ssh-keygenGenerating public/private rsa key pair.Enter file in which to save the key (/home/jmjeong/.ssh/id_rsa): Created directory /home/jmjeong/.ssh.Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /home/jmjeong/.ssh/id_rsaYour public key has been saved in /home/jmjeong/.ssh/id_rsa.pubThe key fingerprint is:SHA256:dddd????..
git repository 생성 discussion topics기본적으로 저장소 생성을 할 수 있지만 여기서는 pyscaffold와 poetry를 이용한 저장소 생성을 알아보자기본적으로는 pyscaffold를 이용한 git 저장소를 생성한다create gitlab repository using pyscaffold1. 새로운 저장소 생성2. 저장소 관련 설정을 해준다3. 이미 존재하는 저장소에서 push 해준다해당 옵션을 선택해야 한다4. 이제 pyscaffold를 이용해 폴더를 생성한다$ putup sandbox_test --markdown$ cd sandbox_test$ git remote rename origin old-origin$ git remote add origin git@git.testdns.dev:jmjeong/sandb..
git config git의 설정 파일각각의 저장소 마다 설정 파일이 있다.아래는 stylegan2의 예제이다.$ cat .git/config[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true[remote "origin"] url = https://github.com/NVlabs/stylegan2 fetch = +refs/heads/*:refs/remotes/origin/*[branch "master"] remote = origin merge = refs/heads/mastergit 주소를 변경하고 싶거나 ssh 로 바꾸고 싶을 때 url 부분을 수정해 주면 된다 - url =..
Git 브랜치 관리 규약how to useprint branch$ git branch -a* main remotes/origin/HEAD -> origin/master remotes/origin/mainmove branch이동할 때는 로컬에 수정사항이 없어야 함.$ git chekcout your_branchkind of branch로컬 브랜치 : 로컬에만 존재하는 브랜치원격 브랜치 : 로컬에서 push 해만 생성되는 원격 브랜치*은 현재 위치하는 브랜치remote/origin이 있으면 원격 브랜치저장소에 따라 main이 아닌 master로 되어 있을 수 있다git의 정책상 master-slave 같은 용어를 지향하고 main 브랜치의 이름으로 옮겨가고 있음.* main remotes/origin/HEAD -> ori..
git 기본 사용법 git 기본 사용법 공식 git 사용법 git 은 가급적 UI가 포함된 IDE를 통해서 사용하는 것이 편하다. 하지만 늘 우리가 예상하지 않은 동작을 할때가 있고 그때는 명확히 하기 위해 command를 사용하는 것이 좋다. 또한 터미널 환경에서 편하게 사용하기에 좋다. git UI 크라켄 : 좋다 하지만 유료 소스트리 : 별로다 하지만 무료 smartgit : 좋다 하지만 유료 크라켄보다는 좋지 않음 GitHub desktop : 아직 잘 모르겠다 pycharm : IDE 중 git 기능이 좋다 visual studio code : 기본 git 기능은 좋지 않지만 plugin을 설치한다면 좋다. 상태보기 master : 현재 브랜치 modified : 수정사항 Untracked files : 추적하지 ..
pre-commit 과 도구들 목적 Git의 pre-commit 은 commit 하기 전에 원하는 동작을 실행해 주는 훌륭한 도구입니다 Python의 경우 필요하다고 판단되는 도구들을 정리해 봤습니다 출처 블로그 http://snowdeer.github.io/git/2021/04/27/use-git-pre-commit/ https://www.daleseo.com/pre-commit/ 제공되는 hook https://pre-commit.com/hooks.html 설치 pip install pre-commit pre-commit-config.yaml 파일 생성 # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more h..