참고 블로그 https://wayhome25.github.io/git/2017/07/08/git-first-pull-request-story/
$ git clone + 내 레포지토리 주소 복붙
[예시]
$ git clone git@github.com:krhopy/finalproject.git
.git 폴더가 들어가있는 첫번째 폴더
$ cd finalproject
$ ls
이 명령어로 finalproject 폴더에 들어온다.
% git remote -v
이러면 성공!!
1. 브랜치 생성
% git checkout -b + 생성할 이름
[예시]
% git checkout -b kangsun
2. 브랜치 생성됐는지 확인
% git branch
[결과]
* kangsun
master
수정 작업 후 add, commit, push
1. 파일추가
% git add .
2. 커밋하고 메세지 작성해주기
% git commit -m "img test"
3. 파일 올리기
% git push origin + branch 이름
% git push origin kangsun
# 코드 동기화
$ git pull + origin/upstream
# 브랜치 삭제
$ git branch -d + 브랜치명
$ git branch -d kangsun
Last login: Tue Nov 29 12:03:33 on ttys000
kangseonlee@kangseonui-MacBookPro git % git clone git@github.com:krhopy/finalproject.git
'finalproject'에 복제합니다...
remote: Enumerating objects: 37, done.
remote: Counting objects: 100% (37/37), done.
remote: Compressing objects: 100% (27/27), done.
remote: Total 37 (delta 2), reused 32 (delta 0), pack-reused 0
오브젝트를 받는 중: 100% (37/37), 139.81 KiB | 313.00 KiB/s, 완료.
델타를 알아내는 중: 100% (2/2), 완료.
kangseonlee@kangseonui-MacBookPro git % cd finalproject
kangseonlee@kangseonui-MacBookPro finalproject % ls
workspace_spring
kangseonlee@kangseonui-MacBookPro finalproject % git remote -v
origin git@github.com:krhopy/finalproject.git (fetch)
origin git@github.com:krhopy/finalproject.git (push)
kangseonlee@kangseonui-MacBookPro finalproject % git checkout -b kangsun
새로 만든 'kangsun' 브랜치로 전환합니다
kangseonlee@kangseonui-MacBookPro finalproject % git branch
* kangsun
master
kangseonlee@kangseonui-MacBookPro finalproject % git add .
kangseonlee@kangseonui-MacBookPro finalproject % git commit -m "img test"
[kangsun 68931c1] img test
4 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 workspace_spring/.DS_Store
create mode 100644 workspace_spring/finalproject/.DS_Store
create mode 100644 "\354\212\244\355\201\254\353\246\260\354\203\267 2022-11-05 \354\230\244\355\233\204 8.06.29.png"
kangseonlee@kangseonui-MacBookPro finalproject % git push origin kangsun
오브젝트 나열하는 중: 12, 완료.
오브젝트 개수 세는 중: 100% (12/12), 완료.
Delta compression using up to 8 threads
오브젝트 압축하는 중: 100% (8/8), 완료.
오브젝트 쓰는 중: 100% (8/8), 382.86 KiB | 1.97 MiB/s, 완료.
Total 8 (delta 3), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (3/3), completed with 1 local object.
remote:
remote: Create a pull request for 'kangsun' on GitHub by visiting:
remote: https://github.com/krhopy/finalproject/pull/new/kangsun
remote:
To github.com:krhopy/finalproject.git
* [new branch] kangsun -> kangsun
kangseonlee@kangseonui-MacBookPro finalproject %
Last login: Tue Nov 29 12:03:33 on ttys000
kangseonlee@kangseonui-MacBookPro git % git clone git@github.com:krhopy/finalproject.git
'finalproject'에 복제합니다...
remote: Enumerating objects: 37, done.
remote: Counting objects: 100% (37/37), done.
remote: Compressing objects: 100% (27/27), done.
remote: Total 37 (delta 2), reused 32 (delta 0), pack-reused 0
오브젝트를 받는 중: 100% (37/37), 139.81 KiB | 313.00 KiB/s, 완료.
델타를 알아내는 중: 100% (2/2), 완료.
kangseonlee@kangseonui-MacBookPro git % cd finalproject
kangseonlee@kangseonui-MacBookPro finalproject % ls
workspace_spring
kangseonlee@kangseonui-MacBookPro finalproject % git remote -v
origin git@github.com:krhopy/finalproject.git (fetch)
origin git@github.com:krhopy/finalproject.git (push)
kangseonlee@kangseonui-MacBookPro finalproject % git checkout -b kangsun
새로 만든 'kangsun' 브랜치로 전환합니다
kangseonlee@kangseonui-MacBookPro finalproject % git branch
* kangsun
master
kangseonlee@kangseonui-MacBookPro finalproject % git add .
kangseonlee@kangseonui-MacBookPro finalproject % git commit -m "img test"
[kangsun 68931c1] img test
4 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 workspace_spring/.DS_Store
create mode 100644 workspace_spring/finalproject/.DS_Store
create mode 100644 "\354\212\244\355\201\254\353\246\260\354\203\267 2022-11-05 \354\230\244\355\233\204 8.06.29.png"
kangseonlee@kangseonui-MacBookPro finalproject % git push origin kangsun
오브젝트 나열하는 중: 12, 완료.
오브젝트 개수 세는 중: 100% (12/12), 완료.
Delta compression using up to 8 threads
오브젝트 압축하는 중: 100% (8/8), 완료.
오브젝트 쓰는 중: 100% (8/8), 382.86 KiB | 1.97 MiB/s, 완료.
Total 8 (delta 3), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (3/3), completed with 1 local object.
remote:
remote: Create a pull request for 'kangsun' on GitHub by visiting:
remote: https://github.com/krhopy/finalproject/pull/new/kangsun
remote:
To github.com:krhopy/finalproject.git
* [new branch] kangsun -> kangsun
kangseonlee@kangseonui-MacBookPro finalproject %