야나도 프로젝트

나도 개발자 될수있어

DB-Oracle

git 과 github / Git for Windows 설치 및 사용

jmeen 2021. 8. 2. 15:50
728x90

[git 과 gitHub]

- git for windows 다운로드 및 설치 : Git for Windows

 

Git for Windows

Git for Windows focuses on offering a lightweight, native set of tools that bring the full feature set of the Git SCM to Windows while providing appropriate user interfaces for experienced Git users and novices alike. Git BASH Git for Windows provides a BA

gitforwindows.org

다음다음다음을 연속으로 눌러 설치를 한다.

기본 설정으로 세팅 후 사용할 예정이다.


[로컬 저장소]

[저장소 만들기]

- 저장된 디렉터리 우클릭 > git bash here 

git innt

저장소 만들기 성공

[저장소 정보 변경]

git config user.name 이름

git config user.email 이메일

[Staging]

- 변경 사항 확인

git status

git add 파일명

git add .

새로운 모든 파일 등록 및 Status 확인. 

[Commit]

 - git commit -m "커밋 메세지"

 

[Log 확인]

git log


[원격 저장소]

[원격저장소 설정]

- github.com

새 저장소의 이름은 SQL로 설정했다.

 

저장소 주소 복사

git remote add origin 원격저장주소

 

[push]

git push - u origin master

 

처음 푸쉬하면 로그인 하라는 메세지가 뜬다. 연결해주면 된다.

git에 등록된 것을 확인할 수 있다.


[업로드 된 파일 가져오기]

새 장비에는 파일이 없다. github에 업로드 된 파일을 불러와보자.

[github에서 주소 복사]

 

[복원하기]

디렉토리에서 오른쪽버튼 -> git bash here

git clone 원격저장소 주소

[저장소 정보 변경]

저장소로 이동후 명령어 실행

git config user.name 이름

git config user.email 이메일

 

[글로벌 옵션]

매번 사용자 이름 설정하지 않게 계속 사용하려면 아래와 같이 설정한다.

git config --global user.name 이름

git config --global user.email 이메일