git版本管理2

1、配置全局姓名和邮箱

git config --global user.name "self"

git config --global user.email "self.M@xxx.cn"

其中的 --global  标识配置全局的参数

在 Windows 系统上,Git 会找寻用户主目录下的 .gitconfig 文件。主目录即 $HOME 变量指定的目录,一般 都是 C:\Documents and Settings\$USER。

 

 新建分支

$ git checkout -b [branch]

 

列出本地所有分支和远程分支

git branch -a

 

 切换到指定分支

git checkout [branch-name]

 

 删除分支

 git branch -d [branch-name]

 

 从远程仓库获取

git clone  http://xxx.xxx.git

 

添加当前目录所有文件到暂存区

git add .

 

 添加指定文件到暂存区

git add [file1]  [file2]

 

显示当前状态

git status

 

 提交暂存区的内容到仓库区

git commit -m "备注信息"

 

 向远程仓库上传

git  push http://xxx.git

 

显示当前分支本地变更历史

git log

 

 切换指定分支,若没有就创建该分支

git checkout -b  " branch-dev-name"

posted on 2022-02-28 10:35  zhishiyv  阅读(21)  评论(0编辑  收藏  举报

导航