您的位置:首页 > 娱乐 > 明星 > git常用命令

git常用命令

2024/10/6 5:50:03 来源:https://blog.csdn.net/qq_43235503/article/details/142135010  浏览:    关键词:git常用命令
命令描述
git branch查看分支;
git branch 分支创建分支;
git branch -D 分支删除分支;
git checkout 分支切换分支;
git checkout -B 分支创建并切换分支;
git switch 分支切换分支;
git switch -C 分支创建并切换分支;
git log查看提交历史;
git reflog查看提交历史树状;
git reset --hard 版本版本回退;
git config --global user.name查看git的用户名称;
git config --global user.name 名称设置git的用户名称;
git config --global user.email查看git的用户邮箱;
git config --global user.email 邮箱设置git的用户邮箱;
git status查看更改的文件状态;
git add .提交全部更改文件到缓存区;
git add 文件提交指定更改文件到缓存区;
git commit -m "描述"提交到缓存区的描述;
git pull拉取远程仓库代码;
git push提交到远程仓库代码;
git remote -v查看远程仓库信息;
git remote add 远程仓库链接本地连接远程仓库;
git remote add 远程仓库链接/origin本地连接并关联远程仓库;
git remote rm 远程仓库链接本地删除远程仓库;

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com