git이나 github를 아예 모른다면

아래를 보자

https://develop-world.tistory.com/11

 

Github에 대한 정리 (+유튜브 강의)

-필요한 프로그램 visual studio code git 우선 위의 두 프로그램을 다운받는다. 1 .git 폴더만들기 우선 새로운폴더를 만들고 vs코드로 그폴더를 연다. 그리고 ctrl + ` 단축키를 입력 터미널을 불러온다.

develop-world.tistory.com

 

소스 업로드


 

1.Github 저장소 만들기

github홈페이지에서 repository 생성 (public or private)

 

2.git remote

 

현폴더의 원격 레파지토리를 확인하는 명령어

git remote

아무것도 뜨지않는다면 연결된게 없다는뜻!

 

git remote add [원하는 원격저장소 이름] [자신의 깃헙 주소].git

ex)

git remote add origin https:github.com/sm7540/practice.git

다시 git remote 해보면

origin이 뜬다.

origin이라는 것은 https:github.com/sm7540/practice.git 와 연결되어있는 것을 임의로 임명했다라고 생각하면된다.

origin =  https:github.com/sm7540/practice.git라고 생각하면될듯!!

 

 

2-1.git remote 깃헙주소변경

 

git remote set-url origin [변경하고싶은 주소]

 

3.git push

 

git push -u [지정한 원격저장소 이름] [branch이름]

ex)

git push -u origin master

업로드 끝!!

 

.gitignore


github에 올릴필요가 없거나 보안적으로 위험한 파일들

 

.gitignore파일을 만들고

파일 이름을 입력하면된다.

 

 

 

.gitignore 끝!!

 

 

소스 다운 받기


1.git clone

git clone [자신의 깃허브 주소]

git clone https:github.com/sm7540/practice.git

1-1.git clone 특정 브렌치

git clone -b {branch_name} --single-branch {저장소 URL} {폴더이름지정가능(선택)}

2.git fetch

github에 올라와있는거와 내파일과 파일을 동기화(현상태 파악)

git fetch

 

3.git status

git fetch이후 어떤게 내파일과 github에 올라와있는파일이 다른지 비교

git status

 

4.git pull

git status를 통해 다른내용을 업데이트

git pull [지정한 원격저장소 이름] [branch이름]

git pull origin master

*pull을 다받기전까지 push를 할수없다.

 

 

 

5.git branch -a

원격과 로컬 브랜치를 전부확인가능하다

git branch -a

 

6원격 저장소의 branch my-idea를 내로컬 branch my-idea로 저장하기

 

.git checkout -b my-idea origin/my-idea

유튜브(얄팍한코딩사전 가장쉬운git강좌-(상))

 

https://www.youtube.com/watch?v=FXDjmsiv8fI

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함