Skip to content

Latest commit

 

History

History
53 lines (47 loc) · 1.92 KB

gitRef.md

File metadata and controls

53 lines (47 loc) · 1.92 KB
Video: What is Git? (Git-SCM) • Git Basics #1 #2
Detailed command line
  • Install git
  • Setup git 1: prepare a working directory, then type
    git init
    
  • Setup git 2:
    git config --global user.name [Username] 
    
  • Setup git 3:
    git config --global user.email [email address] 
    
  • Download the github files to local: (replace your file)
    git pull https://github.com/xxxxx.git
    

If the downloaded files are different from the local, they will then merge with the local. Just input the message and then esc (meaning save) > :wq (meaning exit)

  • Sign up: github account and create your own repository "Respositories" > click the "New" button
  • Modify your file, add your code files etc
  • See cheatsheet here
  • Example: If you want to remove a file > type rm, and if you want to add file or modify the file > type add
    git rm filename.extension
    
    git add filename.extension
    
  • Example continue:
    git commit -m [description e.g delete what]
    
  • Upload the files to github:
    git push --set-upstream [github with your respository url] master
    
  • other useful commands:
    git status
    git diff    //see the difference
    git add *   //staging everything -> then commit -> then push