0%

2022-06-25 git 雜記

2022-06-25 git 雜記

在 openSUSE 安裝 git

安裝指令與參考網站

Sourcetree 密碼權限設定

  1. 在使用 Sourcetree push 到 Bitbucket 時,出現以下錯誤訊息
    1
    Bitbucket Cloud recently stopped supporting account passwords for Git authentication
  2. 根據錯誤訊息,找到解決方式

摘錄回文A (重要設定步驟)

1
2
3
4
5
6
7
8
9
In personal Settings, in the left panel you will find "access management"

Under that you will find "app passwords"

Click on that --> Then you will routed to create app password page

There you can give the required permissions and create password (Note: You have to store that password somewhere as it will be displayed only once)

When you push the code to any repo...use your app password instead of your account password (No need to change any settings in the git_config file)

摘錄回文B (調整後的 URL 格式)

1
https://{{BitbucketUsername}}:{{AppPassword}}@bitbucket.org/{{RepoName}}.git
  1. step by step 實作
  • Bitbucket 進入 Personal settings 頁面
    001

  • 進入 App passwords 頁面
    002

  • 填寫 Label ,勾選適當權限,按下 Create 按鈕
    003

  • 看到彈現出的視窗後,記得儲存該密碼
    004

  • 回到 Sourcetree 程式,點擊右上角的 Settings 齒輪圖示
    005

  • 點選 Path 後,再按下 Edit 按鈕
    006

  • 依下列規則調整 URL/Path

    • 假設先前取得的密碼是 1rTKwWrlMwyUesWe5jB3,在密碼前碼加上: 再放回原始設定值中的 @ 前方
1
2
3
4
5
:1rTKwWrlMwyUesWe5jB3 (在密碼前碼加上:)

https://hccga7@bitbucket.org/hccga7/sourcetree_practice.git (原始值)

https://hccga7:1rTKwWrlMwyUesWe5jB3@bitbucket.org/hccga7/sourcetree_practice.git (調整後)
  • 設定完成後,即可成功 push
    007

未整理的部份

C:\Users\HUNGCHIA\AppData\Local\Atlassian\Sourcetree

Bitbucket Cloud recently stopped supporting account passwords for Git authentication.

1
2
3
4
git remote set-url origin https://<Bitbucket_Username>:<App_Password>@bitbucket.org/<Repo_Name>.git  
git remote set-url origin https://bitbucket.org/hccga7:4???wWr*&*w???SwE5jb7@bitbucket.org/hccga7/sourcetree_practice.git/
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
2
git remote set-url origin git@github.com:user_name/project.git
git remote set-url origin git@github.com:HankChangGSS/GitIoSrc.git

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