123

操作指令

//查看仓库级的 config,命令:
git config –local -l
//查看全局级的 config,命令:
git config –global -l
//查看系统级的 config,命令:
git config –system -l
//查看当前生效的配置, 命令:
git config -l

添加仓库地址
git remote add origin http://git.XXXX.com/XXX/XXX.git/
git姓名邮箱为了让仓库有权限的人识别

一般提交流程

git status
git add .
git commit -m "tag"
git pull <远程主机名> <远程分支名> 取回远程主机某个分支的更新,再与本地的指定分支合并
git push <远程主机名> <远程分支名> 把当前提交到git本地仓库的代码推送到远程主机的某个远程分之上
??远程主机名为什么是origin?

分支

git checkout -b main 新建main分支,并转至main分支
git merge master 合并两个分支
然后就可以进行add,commit
git push -u origin main ,将本地main分支的推送至远程
删除分支
git branch -d branch_name

查看commit

git log 查看所有的commit提交记录
git show 查看提交的详情

posted @ 2022-06-08 10:56  LeiYanRRZZ  阅读(46)  评论(0)    收藏  举报