git init
git status
To add all untracked files: git add .
To add a specific file: git add fileName.txt
git rm file.txt
To remove directories, git rm -r dirName
To record all removals, additions, and modifications in the working tree use: git add -A
-
Giving a commit message:
git commit -m "Meaningful commit message"
-
Adding more files to the last commit (no change in commit message):
git add file.txt
git commit --amend --no-edit
In case commit message has to be changed too,
git commit --amend
suffices the purpose.Note : To push it now, you need to use the force command (Careful!)
git push origin master --force
git config --global user.name "xyz"
git config --global user.email [email protected]
git diff
git log
- Summary parameter will show information such as creations, renames and mode changes:
git log --summary