操作都用 git bash操作: 

如果想用 cmd 或者 PowerShell,系统环境变量 Path 添加 Git 安装路径,如:

C:\Program Files (x86)\Git\cmd  # 改成自己的安装路径

如果配置过,可以先看看以前的配置:

git config -l

 

Config git 配置全局

$ git config --global user.name "your_name"
$ git config --global user.email "your_email@bitmain.com"

生成key

ssh-keygen -t rsa -C "your_email@163.com" 

会得到两个文件:id_rsa和id_rsa.pub,默认位置:C:\Users\[your_account]\.ssh

notepad打开 id_rsa.pub,将密钥复制添加到git

Account -> setting -> SSH Public Keys -> Add Key -> [paste key] -> Add,完成。

 

Bitmain操作:[ ] 表示变量需要修改自己制定

1、克隆 git clone

git clone ssh://[your_email]@10.11.23.152:29418/[project_dir]  # 此处最后有无 .git 后缀均可

2、权限 scp

scp -p -P 29418 [your_email]@10.11.23.152:hooks/commit-msg .git/hooks/

3、添加 git add

git add [. | filename]

4、提交 git commit

git commit -m ["remark"]

5、上传 git push 

git push origin HEAD:refs/for/master

 

【其他】

 删除操作:

git add -A | --all

 

修改操作:

git commit --amend

 

 

 

相关文章:

  • 2022-01-19
  • 2021-10-17
  • 2021-05-14
  • 2022-03-08
  • 2022-01-18
  • 2022-12-23
  • 2021-10-16
  • 2021-11-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-28
  • 2021-04-19
  • 2021-09-03
  • 2021-07-28
  • 2021-08-12
相关资源
相似解决方案