HTTP
SSH
Git
별칭: 원격 서버의 주소는 긴 문자열로 되어 있어 번거롭다. 긴 서버 url 문자열을 별칭으로 만들어 사용할 수 있다.
origin: 대표적으로 사용하는 별칭( 원격 서버와 연결할 때 별칭으로 origin을 사용)
git remote add (원격저장소 별칭) (원격저장소 URL)
원격 저장소 URL에 별칭을 붙인다.
git remote: 연결된 원격 저장소의 이름을 출력
$ git remote -v
origin https://github.com/nahyunbak/writing-app-frontend.git (fetch)
origin https://github.com/nahyunbak/writing-app-frontend.git (push)
7 git remote show 원격저장소별칭 : 원격 저장소의 상세 정보를 출력
master( 로컬) local/master(원격 브랜치)
infoh@hojin MINGW64 /e/gitstudy05 (master)
$ git push origin master -------- 원격 서버로 전송
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 222 bytes | 222.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/jinygit/gitstudy05.git
* [new branch] master -> master
$ cd 메인폴더
$ mkdir gitstudy05_clone -------- 복제할 새 폴더 만들기
$ cd gitstudy05_clone/
infoh@hojin MINGW64 /e/gitstudy05_clone
$ git clone https://github.com/jinygit/gitstudy05.git . -------- 저장소 복제
Cloning into '.'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 3 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
infoh@hojin MINGW64 /e/gitstudy05_clone (master)
$ ls -all -------- 목록 확인
total 13
drwxr-xr-x 1 infoh 197609 0 12월 12 17:23 .
drwxr-xr-x 1 infoh 197609 0 12월 12 17:23 ..
drwxr-xr-x 1 infoh 197609 0 12월 12 17:23 .git -------- 숨김 저
infoh@gitstudy MINGW64 /e/gitstudy05_clone (master)
$ git remote -v -------- 원격 저장소 목록
origin https://github.com/jinygit/gitstudy05.git (fetch)
origin https://github.com/jinygit/gitstudy05.git (push)
infoh@hojin MINGW64 /e/gitstudy05_clone (master)
$ git merge origin/master -------- 임시 원격 브랜치 병합
Updating 6a947b8..668b5ef
Fast-forward
server.htm | 1 +
1 file changed, 1 insertion(+)