본문 바로가기

Git

맥북에서 bash git 사용하기

1. 설치 방법 : https://velog.io/@lovesoulwhy/MacOS-Homebrew-%EB%B0%8F-git-bash-%EC%84%A4%EC%B9%98-%EB%B0%A9%EB%B2%95

 

MacOS Homebrew 및 git bash 설치 방법

git bash를 설치하기 전에, Homebrew 라고 하는 오픈소스 패키지 매니저?패키지 관리 시스템을 설치해야 합니다.순서대로 하시다보면 git bash 설치는 금방금방 끝낼 수 있습니다!홈브루 홈페이지 링크

velog.io

터미널에서 진행하면된다.

 

2. 깃허브에서 미리 레파지토리 만든다.

3. cd 명령어로 원하는 파일로 이동한다.

4. 깃 명령어로 커밋

git add .

git commit -m "메시지"

git remote add origin "2번 순서에서 나온 레파지토리 URL"

> 만약 "error: origin 리모트가 이미 있습니다." 에러가 발생하면 기존 레파지토리 삭제 후 내가 원하는 URL로 등록한다.

> git remote remove origin

> git remote add origin "2번 순서에서 나온 레파지토리 URL"

git push

 > 만약 "fatal: The current branch master has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin master To have this happen automatically for branches without a tracking upstream, see 'push.autoSetupRemote' in 'git help config'." 에러가 발생한다면 브랜치 경로를 master로 잡아준다.

> git push --set-upstream origin master

 

https://velog.io/@diduya/git-%EC%82%AC%EC%9A%A9%EB%B2%95-for-Mac

 

[git for Mac] mac에서 git 사용법

깃이 설치되어 있는 지 확인하고, 설치 되어 있지 않은 경우에는 설치할 수 있도록 안내 메세지가 뜹니다. \*\*\* XCode에 git이 포함되어 있기에, XCode가 설치되어 있는 경우에는 git을 별도로 설치할

velog.io