1, git simple command
git init: Initialization git
mashiqiandeMBP:c mashiqian$ git init Initialized empty Git repository in /Users/mashiqian/Desktop/c/.git/
git status: View the status git
mashiqiandeMBP:c mashiqian$ git status On branch master No commits yet Untracked files: (use "git add <file>..." to include in what will be committed) login.py nothing added to commit but untracked files present (use "git add" to track)
git add: added to the staging area
mashiqiandeMBP: c mashiqian $ git add login.py
Then see the git status again
mashiqiandeMBP:c mashiqian$ git status On branch master No commits yet Changes to be committed: (use "git rm --cached <file>..." to unstage) new file: login.py
git commit -m 'Notes': the submission of documents to the local repository
mashiqiandeMBP:c mashiqian$ git commit -m '立项' [master (root-commit) 3448e89] 立项 Committer: 麻世骞 <[email protected]> Your name and email address were configured automatically based on your username and hostname. Please check that they are accurate. You can suppress this message by setting them explicitly. Run the following command and follow the instructions in your editor to edit your configuration file: git config --global --edit After doing this, you may fix the identity used for this commit with: git commit --amend --reset-author 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 login.py
View git status again this time
mashiqiandeMBP:c mashiqian$ git status
On branch master
nothing to commit, working tree clean
git log: View logs
mashiqiandeMBP:c mashiqian$ git log commit 3448e89964aae9f17442d486ec634e96df6edda8 (HEAD -> master) Author: 麻世骞 <[email protected]> Date: Thu Sep 19 15:06:52 2019 +0800 立项
git config user.name 'add content': add the author's name
git config user.email 'mail': mail Add Author
mashiqiandeMBP: c mashiqian $ git config user.name ' Ma Shi Qian ' mashiqiandeMBP: c mashiqian $ git config user.email ' [email protected] '
Until then view the log
mashiqiandeMBP: c mashiqian $ git log the commit 9284b04c236ac825cc8c4f493098796ef61bd281 (the HEAD -> Master) Author: Ma Shi Qian <[email protected]> a Date: Thu Sep 19 15:17:31 +0800 2019 added a variable