Working with remotes -> Github 쓰면 가능
각각 개발자들이 로컬에 git 을 두고 중간에 upload 하는거를 remote 라고 함 -> 이 작업을 통해, 다른 개발자들이 server에 접근해서 코드를 real time 으로 sync 하고 뭐 하는식 으로 일을 함
Github
저렇게 내 로컬컴퓨터를 쉐어 서버로 두려면, 호스팅 해야되고 하니까 귀찮아서 github라는 서로 git을 공유 하는 centeral server service 가 나옴
github에서 코드 가져와서 내 로컬 컴퓨터로 돌리는식
bitbucket or gitlab 같은 비슷한게 많음
repository size에 따라 돈 charging 함
github account 만든다음, 내 repo 만들어서 코드 쉐어하고, 다른 애들꺼 보고 하는거
Basic interaction with github
READmd (Mark down file)
계속 패스워드 치는거 귗낳으면,
-SSH key-pair 쓰거나,
-Credential helper
쓰면됨 -> 그냥 activate 시키면됨 (git config --global credential.helper cache)
15분 동안 cache에 저장함
-git pull
CommandExplanation & Link
fetch랑 pull의 다른점은 fetch는 그냥 알려만 주는거,
pull은 실제로 가지고 오는거
이럴때 git fetch command 써야됨
이때 remote branch 랑 local branch merge 시켜야함
merge 하려면 git pull 써도 됨
즉
git pull == fetching 한다음 instantly merge 시키는 command 임
CommandExplanation & Links
git remote | Lists remote repos |
git remote -v | List remote repos verbosely |
git remote show <name> | Describes a single remote repo |
git remote update | Fetches the most up-to-date objects |
git fetch | Downloads specific objects |
git branch -r | Lists remote branches; can be combined with other branch arguments to manage remote branches |
An explicit merge creates a new merge commit. This alters the commit history and explicitly shows where a merge was executed.
git fetch will download remote updates, such as objects and refs, from the remote branch.
If you want to see more information about a particular remote branch, you can use the git remote show command. Don't forget the commit ID!
git remote update will fetch the contents of all remote branches and allow us to merge the contents ourselves.
그래서 git pull 이나 fetch, merge 먼저해서 push 해야함
근데, merge confliction 이 있는경우, 고치고, merge한다음, push 가능
Pushing remote branches
브런치 만들고, 푸쉬하면됨
git checkout -b refactor
git Rebase
그냥 옛날껄로 돌린다고 생각 하면 편함
This makes debugging easier and prevents three-way merges by transferring the completed work from one branch to another.
git rebase is useful for maintaining a clean, linear commit history.
wound == 상처, 부상
implicit == 암시된, 내포된
verbosely == 장황하게
fetch == 가지고 오다, 불러오다
explicit == 분명한, 명쾌한
'Service > Git & GitHub' 카테고리의 다른 글
Introduction to Git and Github - Week 4 (0) | 2022.02.20 |
---|---|
Introduction to Git and Github - Week 2 (0) | 2022.02.16 |
Introduction to Git and Github - Week 1 (0) | 2022.02.16 |