N28※git操作

1> 设置用户名与邮箱

git config --global user.name "slzxf"  
git config --global user.email 123456@qq.com   

2> 本地仓库搭建

git init

3> 克隆远程仓库

git clone [url]

4> 生成秘钥

ssh-keygen -r rsa

5> 常用命令

命令名称作用
git status查看本地库状态
git add 文件名添加到暂存区
git add .添加所有文件
git reset HEAD 要移除的文件取消暂存的文件
git commit -m “日志文件” 文件名提交到本地库
git reflog查看历史记录
git log查看版本详细信息
git reset –hard 版本号版本穿梭
git branch 分支名创建分支
git branch -v查看分支
git branch -r列出所有远程分支
git checkout 分支名切换分支
git merge 分支名把指定的分支合并到当前分支上
git branch -d 分支名删除分支
git push origin –delete 分支名删除远程分支
git push origin master将本地的 master 分支推送到 origin 主机的 master 分支

© 版权声明
THE END
喜欢就支持一下吧
点赞1 分享