우선 git-Hub상에서 하나의 레포지토리를 만든다.

이때, 저 위의 HTTPS가 원격저장소의 고유 주소이다.
이제 git remote add 원격저장소_별명 링크 를 통해 연결이 가능하다.
ex) $ git remote add origin [<https://github.com/Ryung-coding/git_test.git>](<https://github.com/Ryung-coding/git_test.git>)
→ 이때 Origin은 기본적인 이름으로 중심 원격저장소 이름으로 많이 이용
git remote를 명령하면 현재 연결된 저장소를 확인
git remote -v 를 명령하면 현재 연결된 모든 저장소 리스트가 확인
→ 여러 원격저장소_별명을 만들어 여러곳에 원격저장을 하는 것이 가능
git remote remove 원격저장소_별명 을 명령하면 저장소간 연결을 제거
연결이 되었다면, git push -u 원격저장소_별명 master 를 통하여 올리면 됨!!
mrl@mrl:~$ cd git에_올리기_위한_파일 경로
//만약, 처음 git과 연동한다면 아래를 해주자
mrl@mrl:~$ git remote add origin 자신의_레포지토리_주소
mrl@mrl:~$ git init
mrl@mrl:~$ git config --global user.email "[email protected]" //자신 이메일
mrl@mrl:~$ git config --global user.name "ryung" //자신 이름
//이후부터는 여기부터 하면 됨
mrl@mrl:~$ git add . //만약 모두 올리고 싶다면 .을 빼면 된다. .은 수정된 파일만 추가하는것
mrl@mrl:~$ git commit -m "여기에 commit 메세지 적는다"
[main e7f836e] 2023.10.6 change 2 link to 5 link
2 files changed, 226 insertions(+), 21 deletions(-)
create mode 100644 robot_arm.asv
//뭐 대충 이런식으로 몇개를 찾았고, 어디가 바뀌고 무슨 파일이다 라고 나오면 성공
mrl@mrl:~$ git branch -M main
mrl@mrl:~$ git push -u origin main //이걸 하면 아래 두줄이 나온다
Username for '<https://github.com>': Ryung-coding //올리는 곳 이름
Password for '<https://[email protected]>': //토큰 적으면 됨
-> 나의 토큰 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
Enumerating objects: 6, done.
Counting objects: 100% (6/6), done.
Delta compression using up to 4 threads
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 4.11 KiB | 2.06 MiB/s, done.
Total 6 (delta 0), reused 0 (delta 0)
To <https://github.com/Ryung-coding/inchworm.git>
* [new branch] main -> main
Branch 'main' set up to track remote branch 'main' from 'origin'. //이러면 성공한거

프로필 ⇒ 셋팅 ⇒ personal acess tokens ⇒classic으로 토큰 생성 (뭐든 권한 아래와 같이 주기)
<aside> 🔥
이떄, 토큰은 이후에 다시는 뜨지않으므로 꼭 어딘가에 잘 보관해놔야합니다!!!!!!!!!!!!!!!!!!!!!!!!
</aside>
$ cd 내가 소스를 복사하고자하는 경로
$ git clone 파일주소(ex <https://github.com/Ryung-coding/inchworm>) 복사폴더 이름
// 내 복사하고자 하는 경로상에 복사하는 파일을 inchworm_beta 라는 폴더라는 이름으로 복사를 원할때
// git clone 파일주소(ex <https://github.com/Ryung-coding/inchworm>) inchworm_beta
Cloning into 'inchworm_beta'...
remote: Enumerating objects: 10, done.
remote: Counting objects: 100% (10/10), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 10 (delta 2), reused 9 (delta 1), pack-reused 0
Receiving objects: 100% (10/10), 4.96 KiB | 4.96 MiB/s, done.
Resolving deltas: 100% (2/2), done.