Collaboration using GIT

Reference

  1. https://www.youtube.com/playlist?list=PLHF1wYTaCuixewA1hAn8u6hzx5mNenAGM

1. GIT YouTube

1.1 Branch

  • git branch: get branch list
  • git branch test1: make a new branch named test1
  • git checkout test1: enter a new branch (* will move to test1). we can add and commit in a new branch.
  • merge
    • git branch master: enter the master branch
    • git merge test1: merge
  • git branch -d test1: delete test1 branch
  • git push origin test1: test1 branch is uploaded to GitHub.

1.2 Conflict

  • When merge, If conflict, the file will be edited by Git.
  • gitk: branch and history visualization

1.3 Pull Request

  • git fetch: pull only changed contents.
  • fork: If we want to request (not as a contributor.) -> pull request -> master: merge
    1. Fork on GitHub
    2. Git clone
    3. Edit… (add, commit, push) x n
    4. New pull request on GitHub -> Create pull request