TortoiseGit

No supported authentication methods available (server sent:publickey)


需要修改 TortoiseGit 网络的 SSH 客户端为 git 服务器的 ssh.exe

could not read form remote repository

原因:

  1. 权限不够

Commit整合


若提交1~6的内容类似有重复,可以将2~6撤销,重新提交到“提交1”。

  1. 在Show log中选择 “提交1”版本;
  2. Reset Type选择Soft,保留当前修改;
  3. Git Commit -> master,提交到“提交1”版本;
  4. 再次查看日志,已去掉重复提交;

Push整合

force push功能,需要当前分支未受保护(unprotected)。
否则强制推送会出错:You are not allowed to force push code to a protected branch on this project

若推送1~6的内容类似有重复,可以将2~6撤销,force push重新推送。

1.2.3.步骤可以参考Commit整合,操作类似。

  1. Push,Options中选择force;
  2. 再次查看日志,已去掉重复推送;

新建空分支

  1. 在主目录下右键点击“Git Bash Here”;
  2. 新建一个空白分支;

git checkout --orphan <new_branch>
git rm -rf .

  1. 提交一个新文件.gitignore;

echo > .gitignore
git add .gitignore

  1. 提交并推送

git commit -m "Initial"
git push origin branch1

新分支branch1创建成功,可以编辑下次提交时需要过滤的文件类型。
可以选择一个模板,比如VisualStudio,在此基础上可以继续添加其他过滤规则。

GitLab 新建仓库

  1. 新建空白项目

  2. 添加 .gitignore

    根据使用语言,选定模板

    然后在后面添加额外的忽略规则。例如

# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp

# JetBrains Rider
*.sln.iml

# else
.svn
*.o
*.lo
*.la
*.al
.libs
*.so
*.so.[0-9]*
*.a
*.pyc
*.pyo
__pycache__
*.rej
*~
\#*\#
.\#*
.*.swp
.DS_Store
[Tt]humbs.db
obj/
bin/
Output/
*.licx
  1. 本地管理
    clone到本地,现在可以commit、push了。

Git Extension

posted @ 2022-07-01 09:31  wesson2019  阅读(111)  评论(0编辑  收藏  举报