카테고리 없음

[Git] Git 관리

Jackerson 2022. 8. 4. 21:28

* Git 설치

- windows 설치 링크 : https://git-scm.com/

 

Git

 

git-scm.com

 

* Git 소스 코드 업로드

- Git 원격지 저장소 생성 (https://github.com/JayKweon/BOILER-PLATE.git)

- 로컬 저장소 초기화 (> git init)

- 원격 저장소 설정 (> git remote add origin https://github.com/JayKweon/BOILER-PLATE.git)

- 업로드 안할 파일 정의 (.gitingnore)

- 로컬 파일 스테이징 이관 ( > git add .)

- 스테이징 올라간 파일 확인 (> git status)

- 파일 커밋 (> git commit -m "first commit"

- 파일 푸시 (> git push origin master)

 

* SSH를 통한 연결

- 생성된 키 확인

> ls -a ~/.ssh

- SSH 키 생성

> ssh-keygen -t ed25519 -C "your_email@example.com"

- 퍼블릭 키 복사

: 복사가 안되면 id_ed25519.pub 파일을 직접 열어서 내용을 클립보드에 복사한다.

clip < ~/.ssh/id_ed25519.pub

- github 에 settings에 복사한 키 추가

- 소스 클론

git clone -b master [ssh 를 통한 git url]

 

* 참고자료

https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

 

Generating a new SSH key and adding it to the ssh-agent - GitHub Docs

About SSH key passphrases You can access and write data in repositories on GitHub.com using SSH (Secure Shell Protocol). When you connect via SSH, you authenticate using a private key file on your local machine. For more information, see "About SSH." When

docs.github.com