Skip to content

Latest commit

 

History

History
85 lines (53 loc) · 1.42 KB

02_push_pull.md

File metadata and controls

85 lines (53 loc) · 1.42 KB

Github TIL (191209~191210)

1. TIL - new commands

  • $ git clone <link>  # copy git repository
    • To get the link, visit the repository (ex. 'Clone or download' in Github)
  • $ touch <file>  # make new file
  • $ git log  # check the whole log
    • $ git log --oneline  # check only the main logs
    • $ git log -1  # check only the last log
  • $ git diff  # check the differences made in git
  • $ cat <file>  # print the file on the monitor
  • $ git push origin master  # push the master to origin
  • $ git pull origin master  # pull the origin to master

2. Push & Pull Workflow

(1) Pull

  1. $ git status  # ★ check the status of git (it should be 'working tree clean')
  2. $ git pull origin master   # pull the changes from Github
    $ git log --oneline  # check the log to compare with Github commits
  3. Various changes in local folder

(2) Push

  1. Various changes in local folder

  2. $ git status  # ★ check the status of git
  3. $ git add <file>  # stage the file for committing
    $ git commit -m "<Commit message>"  # commit the file to git
  4. $ git push origin master  # push the changes to Github
    $ git log --oneline  # check the log to compare with Github commits