176.4. command

简介:

176.4.1. git-add - Add file contents to the index

		
$ echo 'hello world!!!'> newfile
$ git-add newfile
		
		

176.4.2. git-status - Show the working tree status

		
$ git-status newfile
# On branch master
#
# Initial commit
#
# Changes to be committed:
#   (use "git rm --cached <file>..." to unstage)
#
#       new file: newfile
#		
		

176.4.3. git-commit - Record changes to the repository

$ git-commit -m 'add a new file' newfile
Created initial commit f6fda79: add a new file
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 newfile
		

176.4.4. git-show - Show various types of objects

		
$ git-show
commit f6fda79f2f550ea3b2c1b483371ed5d12499ac35
Author: chen <openunix@163.com>
Date:   Sat Nov 1 08:50:45 2008 -0400

    add a new file

diff --git a/newfile b/newfile
new file mode 100644
index 0000000..b659464
--- /dev/null
+++ b/newfile
@@ -0,0 +1 @@
+hello world!!!
		
		

176.4.5. git-checkout - Checkout and switch to a branch

176.4.5.1. checkout master

$ git-checkout master
Switched to branch "master"
			

176.4.5.2. checkout branch

$ git-branch
* master
  mybranch

$ git-checkout mybranch
Switched to branch "mybranch"

$ git-branch
  master
* mybranch
			

176.4.6. git config

$ git config --file config http.receivepack true
		

176.4.7. git log

		
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit

git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ai) %C(bold blue)<%an>%Creset' --abbrev-commit
		
		




原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

目录
相关文章
问题解决:Try to run this command from the system terminal. Make sure that you use the...
问题解决:Try to run this command from the system terminal. Make sure that you use the...
|
Shell
bash: accelerate: command not found
bash: accelerate: command not found
2818 3
autoreconf: command not found
autoreconf: command not found
452 0
g++: command not found
g++: command not found
81 0
|
Linux Shell Windows
Shell - line 2: $‘\r‘: command not found
拷贝脚本提交后报错 line 2: $'\r': command not found,但是这是别的同学可以运行后发给我的,随后开始排查。安装 dos2unix 需要使用 yum。安装 yum 需要使用 brew。
505 0
Shell - line 2: $‘\r‘: command not found
运行 ‘ApiApplication‘ 出错: Command line is too long. Shorten command line for ShopApiApplication or
运行 ‘ApiApplication‘ 出错: Command line is too long. Shorten command line for ShopApiApplication or
237 0
运行 ‘ApiApplication‘ 出错: Command line is too long. Shorten command line for ShopApiApplication or
Error running 'XXXApplication': Command line is too long. Shorten command line forXXX
Error running 'XXXApplication': Command line is too long. Shorten command line forXXX
162 0
Error running 'XXXApplication': Command line is too long. Shorten command line forXXX
Command line is too long. Shorten command line for AppWebStarter or...(已解决)
找到你项目中 .idea/workspace.xml文件 找到 < component name=“PropertiesComponent” > 在标签内部加上这句
172 0
Command line is too long. Shorten command line for AppWebStarter or...(已解决)
|
网络虚拟化 内存技术
|
网络虚拟化 内存技术