GIT workflow

김연혁·2023년 2월 16일
0

TIL

목록 보기
4/4

🐲 Definition

Version Control System
with GIT, you can control versions, back up your files, share your files and put your team's work together


🐲 workflow : single

At first, you should connect Local repository to remote repository(repo). Use this command.
-> git remote add origin url(You give a nickname "origin" to "url")
-> git remote --v
more detail informations, visit this website.

  1. You and co-workes(A, B, C) make their own files in local environment.
  2. Files should be moved from work space to staging area.
    -> git add . (. means all files)
  3. Files should be moved from staging area to local repo.
    -> git commit -m "message you want to leave"
  4. You upload the work to remote repo(Github)
    -> git push origin main
  5. If you refresh the page of your remote repo, it displays files

🐲 workflow : team

Let's say this, you have a project and you want a teammate to add or modify the function of that. With Git, your team can assign the part of the project to individuals, do work at the same time, choose the result if conflict happens(when work overlaps in same place)

  1. connecting your local repo to teammate's remote repo.
    -> git remote add pair url(url from teammate's remote repo)

After it's done, the teammate should clone it from Github

  1. cloning work to local
    -> git clone url

When teammate finish his work in local and upload it to remote repo, you can pull the files your teammate participated in, into your local area.

  1. pulling the files into your local
    -> git pull pair main

The pulled files is in local area, work space exactly. If it happens to conflict because your work and teammate'one overlap, you can check which part has problems and choose 3 options. Your work, teammate's work, modifying directly. When you've done for your work and check the result of your teammate's, push it to Github.

  1. push fianl version of work
    -> git commit -am "message you want to record"
    -> git push origin main
profile
개발 공부 행복

0개의 댓글