码迷,mamicode.com
首页 > 其他好文 > 详细

git$github

时间:2019-09-19 16:16:02      阅读:118      评论:0      收藏:0      [点我收藏+]

标签:initial   check   div   auto   name   res   oba   login   tree   

1、git的简单命令

  git init: 初始化git

mashiqiandeMBP:c mashiqian$ git init
Initialized empty Git repository in /Users/mashiqian/Desktop/c/.git/

  git 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:添加到暂存区

mashiqiandeMBP:c mashiqian$ git add login.py

  这时再次查看git状态

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 ‘注释‘:将文件提交到本地仓库

mashiqiandeMBP:c mashiqian$ git commit -m 立项
[master (root-commit) 3448e89] 立项
 Committer: 麻世骞 <mashiqian@mashiqiandeMBP.lan>
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

  此时再次查看git状态

mashiqiandeMBP:c mashiqian$ git status
On branch master
nothing to commit, working tree clean

  git log:查看日志

mashiqiandeMBP:c mashiqian$ git log
commit 3448e89964aae9f17442d486ec634e96df6edda8 (HEAD -> master)
Author: 麻世骞 <mashiqian@mashiqiandeMBP.lan>
Date:   Thu Sep 19 15:06:52 2019 +0800

    立项

  git config user.name ‘添加内容‘:添加作者名字

  git config user.email ‘邮箱‘:添加作者邮箱

mashiqiandeMBP:c mashiqian$ git config user.name 麻世骞
mashiqiandeMBP:c mashiqian$ git config user.email aaa@163.com

  此时再查看日志

mashiqiandeMBP:c mashiqian$ git log
commit 9284b04c236ac825cc8c4f493098796ef61bd281 (HEAD -> master)
Author: 麻世骞 <aaa@163.com>
Date:   Thu Sep 19 15:17:31 2019 +0800

    添加了一个变量

 

git$github

标签:initial   check   div   auto   name   res   oba   login   tree   

原文地址:https://www.cnblogs.com/490144243msq/p/11550027.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!