git 的常用命令

git的复制粘贴
Ctrl+ins 复制 Shift+ins 粘贴

git拉代码
git clone https://xxxxxx/xxxx.git
git clone -b wk_20210712 https://ccccxxxxx.git 指定分支拉代码

git remote -v查看项目远程地址。

git pull 本地与服务器端同步(拉代码)
git add 添加到更改
git add --all 全部添加到更改
git commit -am “init” 提交并且加注释
git commit 提交 到本地仓库
git push提交 到远程仓库
git push origin master 将文件给推到服务器上

git config --global user.email xxx 设置邮箱
git config --global user.name xxx 设置git 用户名称
git config --list ==>查看那么和email等等

ctrl+L 清屏

有这个报错的时候,

husky > commit-msg (node v14.16.1)
⧗   input: 五矿的部分bug修改
✖   subject may not be empty [subject-empty]
✖   type may not be empty [type-empty]

✖   found 2 problems, 0 warnings

先用git这个命令,然后在推送就可以了

git commit -m "备注信息" --no-verify

解决操作git在vscode总让输入用户名及密码问题
我们打开终端,会看到cmd定位在我们仓库位置,我们只要添加:

git config --global credential.helper store

再退出vscode并重启

查看当前状态
git status

如果报错这个

failed to push some refs to ‘https://ccxxxxxxx/git/trade-web.git’(未能将一些裁判推到)

2.如果报这个错 cannot pull with rebase: You have unstaged changes.(无法使用rebase进行拉取:您有未暂存的更改。)

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值