github에 처음 push 하기
github에 처음 push하기위해서 msysgit을 사용한다. (GUI는 재미없음)
1. msysgit을 설치하고 실행
2. github에 올리고자 하는 workspace로 가서 오른쪽클릭->git bash를 실행
(만약 git bash가 없으면 그냥 시작프로그램에서 Git Bash 실행해서 cd 명령으로 이동)
3. Local Repo 생성. 아래의 명령어를 치면 master branch가 생성된다.
$ git init
$ git add .
4. 첫 Local Commit
$ git commit -a -m "메시지 입력"
5. Local Git에서 사용할 global 변수 설정
$ git config --global user.name "Author 를 위한 사용자 이름"
$ git config --global user.email 사용자Email
6. github에서 미리 생성 해놓은 .git repo 주소에 local origin을 add
$ git remote add origin https://github.com/ManSung-Kim/SoundSpreadingProject.git
7. local origin을 remote master(github 서버)에 push
$ git push -u origin master
push 성공시 아래와 같이 뜬다.
Username for 'https://github.com': ###################
Password for '######################
Counting objects: 29, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (23/23), done.
Writing objects: 100% (29/29), 8.67 KiB | 0 bytes/s, done.
Total 29 (delta 0), reused 0 (delta 0)
To https://github.com/##########/SoundSpreadingProject.git
* [new branch] master -> master
Branch master set up to track remote branch master from origin.
8. github에 접속해서 push 확인
끝!
% git 명령어는 구글링
% git commit 전에는 꼭 git status와 git log -1로 상태 확인(소스날리기싫으면)