Git[3] Respositroy 생성 및 운영
Workspace 생성
git_test 폴더로 이동
cd git_test
git init
폴더에서 git을 초기화하는 명령어
git init
파일생성
touch test.txt
Git Status
Git 에존재하는파일확인
git status
Git Add
Working Directory 에서변경된파일을 Index (stage)에추가
git add test.txt
git status
branch에 추가됨을 확인 할 수 있음
Git Commit
Index (stage) 에추가된변경사항을 HEAD 에반영 (확정)
git commit -m "commit 에 대한 설명" <filename>
git commit -m"new commit" test.txt
원격 Repsoitroy 생성
Github Token 생성
보안상의이유로 Remote Repository 접속시 비밀번호대신 Token 을사용
사용자메뉴에서 Settings 선택
이후에는 Token 값이보이지않으므로 반드시 복사해둘것!!
왼쪽상단고양이를눌러서 GitHub Home 으로이동 > 생성해둔 Remote Repository 선택
Local Repository 에 Remote Repository 등록
• Remote Repository을 등록
git remote add origin https://github.com/<repository>.git
• Remote Repository을 토큰을 이용하여 등록
it romote add origin https://<token>@github.com/minjea1588/git_test.git
연결확인
git remote -v
Git Push
Remote Repository 확인
Remote Repository 페이지에서새로고침하면 Push 된파일이보임
Remote Repository 의내용에맞춰 Local Repository 를갱신하려면 Git Pull 사용
ReadMe 파일생성
• Add a README 버튼클릭
Git Pull
• ReadMe 파일을 Local Repository 로 Pull
git pull origin master