Git

Git 사용방법

goshek 2024. 7. 29. 17:16

https://git-scm.com/download/win

 

Git - Downloading Package

Download for Windows Click here to download the latest (2.45.2) 32-bit version of Git for Windows. This is the most recent maintained build. It was released about 2 months ago, on 2024-06-03. Other Git for Windows downloads Standalone Installer 32-bit Git

git-scm.com

 

64bit Git for windows setup으로 설치

 

필수 사항은 거의 체크되어있으므로 전부 Next, Install

 

git init

$ git branch -M main

 

 git config --global user.email "you@example.com"
 git config --global user.name "Your Name"

 

 git config --global user.email 

 git config --global user.name

으로 잘 입력되었는지 확인.

 

파일관리자에서 자신이 원하는 파일에 open git bash here 옵션 선택

이 후 출력되는 github 로그인 창에서 로그인

이 후 원하는 파일

 

$ git add .

$ git status

$ git commit -m "원하는 파일명"

 

$ git push origin main

 

 

==생성된 원격 환경과 로컬 환경 연결 ==

1. 새로운 로컬 환경 생성(새폴더 생성)

 

2. git bash 환경에서 깃 환경 설정 진행

-git init

-git branch -M main

-git remote add origin 주소

 

3. 원격의 데이터를 로컬 환경으로 내려받기

-git pull origin main

 

 

==Visual Code Terminal에서 해당 파일을 커밋(업로드)==

git init

 

git branch -M main

 

git remote add origin git_리포지토리 주소 /* Git에서 자신의 git 주소 확인 가능*/

 

git status

 

git add.

git commit -m "원하는 커밋 명" /*해당 날짜로 작성 추천*/

git push origin main

 

==Visual Code Terminal에서 git 파일/폴더를 해당 파일에 가져오기==

git init

git branch -M main

git remote add origin깃주소

git pull origin main