Skip to content

mikiwang820/git

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 

Repository files navigation

git

Introduction

  • What is git?
    • A kind of distributed version control system
  • Why git?
    • Track history
    • Work together
  • Three different levels of user
    • System: all users
    • Global: all repositories of the current user
    • Local: the current repository
  • Structure of git
    截圖 2021-09-07 下午4 16 51

Basic commands

  • check the version of git
    git --version
    
  • Setting
    git config --global user.name "<your name of account>"
    git config --global user.email <your email>
    
  • Clone repo
    git clone <URL>
    
  • Push repo
    • You will need to input your username and passward after git push, but the passward here is not your Github's passward. First of all, you have to go to Settings => Developer Settings => Personal Access Token => Fillup the form => click Generate Token and then copy it for the passward.
    # start a new repo locally
    git init
    # add a remote repo
    git remote origin add <URL>
    # add a change in the working directory to the staging area
    git add <your file>
    # Take the staged snapshot and commits it to the project history
    git commit -m "<description>"
    # push to your repo on Github
    git push
    
  • Check file ststus
    git status
    
  • Use git to delete a file
    git rm <file>
    # update all files status
    git add -u
    git commit -m "<Remove a file>"
    # find out the history
    git log
    

Reference

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published