初始化仓库
git init
查看状态
git status
添加文件
git add 文件名(*指的是全部)
配置个人信息
git config user.name 你的名字
git config user.email 你的邮箱
提交代码
git commit -m 版本信息
查看日志信息
git log --oneline
回退
git reset --hard HEAD/版本号
关联远程仓库
git remote add origin https://gitee.com/myasn/git_test.git
(https后面的内容需要填写自己的仓库地址)
提交代码到远程仓库
git push -u origin "master"
获取远程仓库的代码
git pull origin master
分支操作
查看分支
git branch
创建分支
git branch b1
切换分支
git switch 分支名
将b1分支合并到master
git switch master
git merge b1
get的基本操作
最新推荐文章于 2022-06-24 18:53:33 发布