git basic entry/common commands

github function: source code version control

  • flow chart
  • Create warehouse
  • git tool initialization

Configure user information

`$ git config --global user.name "用户名"`
`$ git config --global user.email "邮箱"`

View configuration information

`$ git config -l`

clone

`$ git clone https/ssh`

Submit three processes

推向暂存区
	$ git add.
	$ git add <file>
	git add . <file>		//一次性添加多个文件

查看暂存状态
	`$ git status`

推向本地库
	$ git commit -m "提交注释"`	//第一次提交

推向远程库
	$ git push`

查看提交记录
	$ git log
	$ git log 2
	$ git log oneline

恢复指定版本
	`$ git reset --hard 版本号`

从暂存区拿出文件
	`$ git reset HEAD <file>`

帮助命令
	`$ git 命令 --help`



Guess you like

Origin blog.csdn.net/weixin_46622106/article/details/110851514