Git installation and use of git common instructions

Git installation and use

Nanny-level teaching, Xiaobai can read it~

1. Install git

git official website
After entering the official website, click the Download for Windows button to download.
insert image description here
This process may be a bit long. After all, it is not a domestic website. Wait patiently, wait for the download to complete and open it, and then click the
right mouse button on the desktop after the installation is complete. If it appears
Git GUI Here
Git Bash Here
These two options prove that the installation was successful

Two, git commonly used commands

// 初始化一个git仓库
$ git init
// 克隆一个git仓库
$ git clone 仓库的地址
// 查看配置信息
$ git config
// 添加文件到缓存命令
$ git add .或者文件路径
// 查看文件的是否添加成功
$ git status
// 查看更新的详细信息命令
$ git diff
// 提交命令,备注/注释
$ git commit -m"注释信息"
// 查看分支命令
$ git branch
// 创建分支命令
$ git branch (分支名字)
// 合并分支命令
$ git merge 分支名字
// 切换分支命令
$ git checkout (要却切换分支的名字)
// 删除分支命令
$ git branch -d (要删除分支的名字)
// 添加远程仓库
$ git remote add
// 查看当前的远程仓库
$ git remote
// 提取远程仓仓库
$ git pull
// 推送到远程仓库
$ git push
// 删除远程仓库
$ git remote rm [名字]
// 配置提交记录中的用户信息
$ git config --global user.name <用户名>
$ git config --global user.email <邮箱地址>
// 显示提交的记录
$ git log

You can also follow my personal blog , which is synchronized with csdn, and I will continue to update it, thank you for your support~

Guess you like

Origin blog.csdn.net/weixin_55659609/article/details/130265324