[Github] Github 파일 업로드

gogori6565·2022년 6월 22일
0

Git-Github

목록 보기
1/7

Git 초기 세팅 (Git bash)

  1. git config --global user.name [사용자이름]
  2. git config --global user.email [사용자이메일]
  3. git config --global --list : 설정값 확인

Github 파일 업로드

방법 1) 로컬 디렉토리 선택하여 적용 - git init

//cd 명령어로 해당 폴더(디렉토리) 들어가기
1. git init
2. git add [파일명]
3. git commit -m "[커밋내용]"
4. git remote add origin [repository명]
5. git push origin [브랜치명]

해당 폴더에서 다른 repository로 git 저장소를 변경하고 싶을 때,

1. git remote remove origin                      //repository 삭제
2. git remote add origin [새로운 repository명]
3. git pull origin [브랜치명]					 //pull 반드시 해야함!

git init 취소

rm -rf .git

방법 2) 원격저장소를 로컬저장소로 복제 - git clone

//복제할 위치로 이동 후 수행
1. git clone [repository url]	//github repository 연결
2. git add [파일명]
3. git commit -m "[커밋내용]"
4. git push origin [브랜치명]
profile
p(´∇`)q

0개의 댓글