git命令

29次阅读

共计 183 个字符,预计需要花费 1 分钟才能阅读完成。

git cherry-pick [commit 号]

把一个 commit 复制一份到当前分支。

git reflog

HEAD 曾经指向过的 commit 的历史。

git push origin :[分支号]

删除远端仓库的某个分支

git --amend --author='zhangsan'

修改 commit 的 author

git rebase -i [commit 号]

通过修改 commit 列表 rebase

正文完
 0

git命令

29次阅读

共计 1296 个字符,预计需要花费 4 分钟才能阅读完成。

Git 命令

环境:git 客户端,gitlab 网页端,putty 客户端
安装完 git 客户端之后生成公钥:ssh-keygen -t rsa -C “ 邮箱名 @qq.com”
更新下来:git pull
查看修改:git status
新增:git add .
提交:git commit -m ‘ 提交注释 ’
上传:git push
:q:退出命令
冲突解决方案,即 gitlab 覆盖我的(我并不作更新,否则冲突):git checkout ‘main.html’
下载:git clone git@gitlab.xxx.com:xxx/base.git

注意:1)没有 pull 的情况下报错
To gitlab.xxx.com:jbid/bid.git ! [rejected] master -> master (fetch first)error: failed to push some refs to ‘git@gitlab.xxx.com:jbid/bid.git’hint: Updates were rejected because the remote contains work that you dohint: not have locally. This is usually caused by another repository pushinghint: to the same ref. You may want to first integrate the remote changeshint: (e.g., ‘git pull …’) before pushing again.hint: See the ‘Note about fast-forwards’ in ‘git push –help’ for details.
2)通过 post 传递对象时候 (不过现在都用 postman 软件):
git:(post 方法本地测试)curl -H “Content-Type:application/json;charset=utf-8” -X POST http://localhost:81/xxxinfo/reguser -d ‘{“sessionkey_3rd”: “c24f4a3b9f414ae54e46536649f61688″,”username”: “mingzi”,”password”: “123456”,”busilicence”: “00”,”mobile”: “ 具体手机号码 ”,”captcha”: “”}’git:(post 方法正式环境测试):curl -H “Content-Type:application/json;charset=utf-8” -X POST https://bidmini.xxx.cn/xxxinf… -d ‘{“sessionkey_3rd”: “c24f4a3b9f414ae54e46536649f61688″,”username”: “ 名字 ”,”password”: “123456”,”busilicence”: “03”,”mobile”: “ 具体手机号码 ”,”captcha”: “”}’

3)git 实现 post 请求时候对 windows 系统的中文执行不了,下面文章链接是参考:
https://blog.csdn.net/qq_2112…

正文完
 0

Git命令

29次阅读

共计 25 个字符,预计需要花费 1 分钟才能阅读完成。

查看本机 git 配置:
git config –list

正文完
 0