Remote Repository 생성 본문
** git commit 하는 프로세스 Git add > commit -m"message" file.type > git push origin master
** 로컬 wd > git pull origin master > 파일 확인
** Github 홈페이지로 이동, 서버에서 create repository 해준다

** Repository name : 레포지터리 이름 기입
** Public / Private : 공개 유무 설정
** 다른 옵션들은 현재 체크하지 않는다 ( 빈 폴더 )

** Github token : 보안상 이유로 Remote Repository 접근 시 아이디 비밀번호 -> Token 으로 사용
* 사용자 메뉴 > Settings > Developer Settings > personal access tokens > generate new token
* 토큰의 사용 범위 설정 , 만기 기한 설정

* generate한 Token은 보안적으로 잘 관리한다 ( 다시 확인할 수 없음 )
** Remote Repository 에 등록하기

* 터미널에서 > git ( master branch )에서 관리하는 폴더로 이동, 이후 해당 작업 실행
* git remote add origin https주소.git -> 아이디와 비밀번호를 매번 입력해야 하고
* git remote add origin https://username:token@github.com/repository.git -> 유저 네임과 토큰으로 바로 push & pull
> 명령어는 Git 페이지의 도움말 참고

* Remote Repository 로 정보 확인
git remote -v , 수행 후 fetch 와 push 두줄이 출력된다

** Git Push
project_folder % git push origin master
( git 명령어 Push 수행 , origin repository 의 master 브랜치에 명령을 수행 )
** 이후 git 의 remote repository 페이지에서 commit 메시지와 push 파일을 확인할 수 있다.
** Git pull 하기
project_folder % git pull origin master
ls 로 확인

'BF 2024 > Git' 카테고리의 다른 글
Remote repository / Branch (0) | 2022.03.30 |
---|---|
Log / Diff (0) | 2022.03.30 |
Local Repository (0) | 2022.03.29 |
Git 기본용어들 (0) | 2022.03.29 |
Git 가입 및 global configuration 설정 (0) | 2022.03.29 |