본문 바로가기
괴발개발/git

git 사용하기 (부제 : git bash 명령어)

by 맛길만걷자 2024. 2. 12.
728x90
반응형

git 설치

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

 

Git - Downloading Package

Download for Windows Click here to download the latest (2.43.0) 32-bit version of Git for Windows. This is the most recent maintained build. It was released 3 months ago, on 2023-11-20. Other Git for Windows downloads Standalone Installer 32-bit Git for Wi

git-scm.com


git bash 설정

깃계정과 연결하기.

"Name, E-mail 본인계정"

git config --global user.name "Name"
git config --global user.email "E-mail" 


계정 연결확인

git config --list 


깃 버전확인

$ git --version

 

git clone
git 레파지토리 복제

$ git clone 리포지토리 주소

 

init
초기화 명령어.
컴퓨터에서 생성한 디렉토리(폴더)를 Git에 등록하여 관리할 수 있도록 하는 명령어

$ git init

 

변경사항 확인 명령어

$ git status

 

모든파일 불러오기

git add .

 

업로드 메시지 입력

$git commit -m "메시지"

깃 레파지토리 주소연결

git remote add origin 주소


주소삭제
git remote remove origin

주소확인

git remote -v


업로드

$ git push
$ git push origin main(or master)
$ git push origin branch


불러오기 pull

$ git pull
$ git pull origin main(or master)
$ git pull origin branch


합치기

$ git merge




error: 'java_study/' does not have a commit checked out

> .git 파일 중복시 뜸 . .git 파일은 숨김파일로 되어있음. 중복된거 둘중하나 삭제.

fatal: 'origin' does not appear to be a git repository
주소 확인 후 삭제, 다시 주소업로드 하면 된다.

 

git bash 어렵당.. 차차 익숙해 지겠지.

728x90
반응형