My Git learning notes

Git Basic

  • Git Help
    • $ git help
    • $ git help config
  • Setting up git
    • $ git config –global user.name “xxx”
    • $ git config –global user.email “xxx@xxx.com”
    • $ git config –global color.ui true
  • Starting a Repo
    • $ git init
    • Work flow:
      • create file aaa.txt
      • add aaa.txt to staging area
      • commit changes
      • modify aaa.txt
      • add aaa.txt to staging area
      • commit changes
    • $ git status : watch the status
    • $ git add aaa.txt : add the modified file into staging area
    • $ git commit -m “hahaha!”
    • $ git add aaa.txt bbb.txt : add two files to staging area
      $ git add –all
      $ git add *.txt : add all txt files in current directory
      $ git add docs/*.txt
      $ git add docs/
      $ git add “*.txt” : add all txt files in the whole project
    • $git commit -m “hahahaha!”
  • Timeline History
    • $ git log

(more…)

0 Comments

Useful links for Git

git Reference help.github Pro Git (free ebook) GitLab codeschool course for Git Tutorialspoint for Git Egit Icon Decorations

0 Comments

Useful Git Commands

$ git init #initialize an empty Git repoistory $ git status #see the current state of the project untracked file: it is a new file and not be tracked by Git…

0 Comments