[TIL] Git and Github

Agnes Shin·2022년 2월 27일
0

Recap for Git & GitHub

What is Git?

  • Git is at local storage in my computer, marked at local status

What is GitHub master?

  • rename from master to main, due to racist comments
    from slave to master

  • remote repostiory


What are the commands?

  • the -m means message,
    when you make a commit, need to write a message based on what you WIP, ADD, FIX, DELETE, in detail

How to create a file from Git?

  • command to make directory
    mkdir
  • command to create file from iTerm2 or Terminal
    touch nameoffile.md

How to startup iTerms commands

  • [1] to run iTerms/terminal
    npm start

  • [2] to stage all saved files, with the dot . means to stage all
    git add .

    either or

  • [3] to stage one file at a time, without the dot
    git add

  • [4] check status of staging
    git status

  • _[5] without -m "Message", will represent a single commit, without be vis
    git commit

  • [6] git commit -m "first initial commit"
    **git commit

  • [7] git push origin master

  1. git commit -m "Add: Login, Main"
  2. git push origin feature/yunsook (push commit into remote)
  3. request PR to mentor regarding to be reviewed (Pull Request)
  4. when request is reviewed and verified, mentor will then approved to merged in Github
    to be posted in github which is the master where the codes are approve
  5. git branch (check to see location)
  6. git checkout master
  7. git pull master (update files)
  8. git checkout feature/yunsook (change branch) or
    git switch feature/yunsook
  9. git feature/yunsook merge master (git)

git status (on branch feature/yunsook -> changes to be. commited
/ use "git restore --staged ..." to unstage)
/ to distinguish the new files to be loaded will be in green marked as new files, or modified
git add .
git status >>> git commit -m “Add: Login, Main”
(when you commit,this status is still in the temporary local, before going to the master of Github)
git push origin feature/yunsook (local working location)
next step is to send
git merge from github
git branch (this is to locate the branch)
git branch master (branch is located in the master)
git checkout master (is to leave and switch to the master local)
git branch (git branch)
git checkout feature/yunsook (switched to branch 'feature/yunsook'
(it's switched to brand 'feature/yunsook')

profile
30기 신윤숙 / FE

0개의 댓글