본문 바로가기

버전관리/Git

Git 설치와 첫시작

반응형

깃허브에 저장소를 만들고 기존 소스나 파일들을 처음 커밋하고 푸쉬

 

 깃허브 접속 github.com

 

GitHub: Where the world builds software

GitHub is where over 56 million developers shape the future of software, together. Contribute to the open source community, manage your Git repositories, review code like a pro, track bugs and feat...

github.com

1. 접속 한 다음 로그인 후 왼쪽 상단에 New를 눌러준다.

2. Repository Name(저장소 이름)을 넣고 설명을 넣어준다.

옵션들은 선택해서 체크

 

여기까지하면 깃허브에 레파지토리 생성이 완료

 

이제 로컬에 있는 소스를 올려보기

 

1. 사용자의 컴퓨터에서 깃허브에 연결하기 위한 Git 클라이언트 설치

 

git-scm.com/downloads

 

Git - Downloads

Downloads macOS Windows Linux/Unix Older releases are available and the Git source repository is on GitHub. GUI Clients Git comes with built-in GUI tools (git-gui, gitk), but there are several third-party tools for users looking for a platform-specific exp

git-scm.com

2. 설치 후 원하는 소스 폴더에서 Git Bash Here을 눌러줌!

 

3. 명령어 치기

    git init (저장소 만들기)

    git config --global user.name "[이름]" (로그인 이름)

    git config --global user.email "[메일]" (로그인 메일)

    git add [.] or [파일명] (해당 폴더의 파일을 로컬저장소에 올림) 특정파일만 올릴때는 . 대신 파일명

    git commit -m "[Push 메시지명]"(커밋)

 

4. Github 저장소로 올리기(Push)

   Github 자신의 저장소로 가서 Code를 누르면 주소가 나옴

 

5. 복사한 주소로 리모트 저장소 설정

     git remote add origin [저장소 주소]

6. 아까 커밋한 소스들 Push

     git push origin master

반응형