본문 바로가기

반응형

Git

(5)
Github에 잘 못 올라간 파일 삭제하기 --cached를 이용해서 github server의 파일 만 삭제할 수 있다. $ git rm --cached db.sqlite3 rm 'db.sqlite3' $ git rm --cached SunnyBlog/settings.py rm 'SunnyBlog/settings.py' 이후에 git status 확인하고 Commit 하고 push 하면 로컬에는 남아 있고 github에서는 지워진다. $ git status On branch main Your branch is up to date with 'origin/main'. Changes to be committed: (use "git restore --staged ..." to unstage) deleted: SunnyBlog/settings.py de..
git 초기 설정 1. git repository를 생성하고자 하는 디렉토리에서 git init 명령이 입력 $ git init hint: Using 'master' as the name for the initial branch. This default branch name hint: is subject to change. To configure the initial branch name to use in all hint: of your new repositories, which will suppress this warning, call: hint: hint: git config --global init.defaultBranch hint: hint: Names commonly chosen instead of 'master..
github에 PC public key 연결하기. 1. git hub에 가입 2. New 버튼으로 Repository 생성 대표사진 삭제 사진 설명을 입력하세요. 3. github.com > Settings > SSH and GPG keys 에서 SSH Keys 추가 4. ssh public key 얻는 방법 - 명령 프롬프트에서 ssh-keygen을 실행하여 생성 된 id_rsa.pub 파일을 editor로 열면 확인 가능한 public key를 복사하여 SSH Keys에 추가하면 된다.
Git 특정 폴더 아래의 전체 파일 무시하기 1. vi를 이용하여 ignore 파일을 연다. vi .gitignore 2. 맨 아래쪽으로 가서 무시하고자 하는 폴더 위치를 아래 처럼 넣는다. # Uploaded Static Files static/uploaded/ 흰 배경흰 배경회색 가로줄 배경회색 가로줄 배경어두운 배경어두운 배경 삭제삭제 3. gitstatus를 했지만 위의 특정 폴더 아래 변경사항은 안보이게 된다. $ 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 ..." to di..
git 명령어 정리 https://git-scm.com/downloads 에서 git 설치 Git Bash를 연다. KimJeongHoon@user-PC MINGW32 ~$ git config --global user.name "JeongHoonKim" KimJeongHoon@user-PC MINGW32 ~$ git config --global user.email "devkjh@gmail.com" 로컬 저장소 만들기KimJeongHoon@user-PC MINGW32 ~$ mkdir boot KimJeongHoon@user-PC MINGW32 ~$ cd boot KimJeongHoon@user-PC MINGW32 ~/boot$ git initInitialized empty Git repository in C:/Users/Ki..

반응형