This article is about the usage of git.

Add a new repository

  • add a new repository on github.com
  • mkdir with the same name
  • create some thing
  • git init
  • git add
  • git commit
  • git remote add origin repository URL
  • git push origin master

Basic operations in git

git init

git status

git add

git add -A add all files modified

git add -An show all the files will be added but don't add

git commit

git commit -m "commit comments"

git push

git push --dry-runDo everything except actually send the updates.

Problems

rename a directory

Basic rename (or move):

git mv *oldname* *newname*

Case sensitive rename—eg. from casesensitive to CaseSensitive—you must use a two step:

git mv casesensitive tmp
git mv tmp CaseSensitive