2022-06-25 git 雜記
在 openSUSE 安裝 git
安裝指令與參考網站
- 安裝指令
1
2
3sudo zypper in git-core
git --version - 參考網站
How to install git on SUSE
Sourcetree 密碼權限設定
- 在使用 Sourcetree push 到 Bitbucket 時,出現以下錯誤訊息
1
Bitbucket Cloud recently stopped supporting account passwords for Git authentication
- 根據錯誤訊息,找到解決方式
摘錄回文A (重要設定步驟)
1 | In personal Settings, in the left panel you will find "access management" |
摘錄回文B (調整後的 URL 格式)
1 | https://{{BitbucketUsername}}:{{AppPassword}}@bitbucket.org/{{RepoName}}.git |
- step by step 實作
進入 App passwords 頁面
002
填寫 Label ,勾選適當權限,按下 Create 按鈕
003
看到彈現出的視窗後,記得儲存該密碼
004
回到 Sourcetree 程式,點擊右上角的 Settings 齒輪圖示
005
點選 Path 後,再按下 Edit 按鈕
006
依下列規則調整 URL/Path
- 假設先前取得的密碼是 1rTKwWrlMwyUesWe5jB3,在密碼前碼加上: 再放回原始設定值中的 @ 前方
1 | :1rTKwWrlMwyUesWe5jB3 (在密碼前碼加上:) |
- 設定完成後,即可成功 push
007
未整理的部份
C:\Users\HUNGCHIA\AppData\Local\Atlassian\Sourcetree
Bitbucket Cloud recently stopped supporting account passwords for Git authentication.
1 | git remote set-url origin https://<Bitbucket_Username>:<App_Password>@bitbucket.org/<Repo_Name>.git |
https://hccga7:4RtKwWrLmwyUeSwE5jb7@bitbucket.org/hccga7/sourcetree_practice.git
未整理的部份-SSH
1 | git remote set-url origin git@github.com:user_name/project.git |
文章重點備份
github: No supported authentication methods available
- Using TortoiseGit
TortoiseGit > Settings … Network … SSH Client: C:\Program Files\Git\usr\bin\ssh.exe
Location my vary. On one computer it was in C:\Program Files (x86)\Git\bin\ssh.exe
008
- Using TortoiseGit
-
1
ssh-keygen -t rsa -b 4096 -C "hankchanggss@gmail.com"
D:\Blog\_ssh_key>ssh-keygen -t rsa -b 4096 -C “hankchanggss@gmail.com“
Generating public/private rsa key pair.
Enter file in which to save the key (C:\Users\HUNGCHIA/.ssh/id_rsa):
C:\Users\HUNGCHIA/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in C:\Users\HUNGCHIA/.ssh/id_rsa.
Your public key has been saved in C:\Users\HUNGCHIA/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:/kMIrvJr1/LJWuDf62YUVLcV0C9uuE3+m66zx8RwlQw hankchanggss@gmail.com
The key’s randomart image is:
+—[RSA 4096]—-+
| ..E*.+|
| . . *.|
| . . o|
| . . ….|
| …S. . o+. |
| ..o. o . +o |
| …oo o |
| . o o+.++ ..oo.|
| +oo.+=+=o o=o|
+—-[SHA256]—–+
D:\Blog\_ssh_key>
eval “$(ssh-agent -s)”
ssh-add ~/.ssh/id_rsa