Skip to content

Instantly share code, notes, and snippets.

@zhentian-wan
Created April 27, 2020 18:16
Show Gist options
  • Save zhentian-wan/5e26b8ef1ddd4ee7a5391ef6f8cf1770 to your computer and use it in GitHub Desktop.
Save zhentian-wan/5e26b8ef1ddd4ee7a5391ef6f8cf1770 to your computer and use it in GitHub Desktop.
Git basic skill tips

Git basic skills

For an empty project

git init git-demo

For an existing project

cd git-demo
git init

Which files have been changed?

git status

Add file to staging area

git add <file1_name> <file2_name>

or

You can add all files

git add .

Commit files to local repo

git commit -m "commit message"

Push files to remote repo

For an empty project

git remote add origin <url>

git push -u origin master

For an existing project

git push

or

git push -u origin master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment