使用MobaXterm 加載GIT,并下載項目

MobaXterm 下載地址:

https://mobaxterm.mobatek.net/download.html
本人使用的版本:https://wwn.lanzouv.com/iVewO09wiqfg

MobaXterm 下載Git步棸

打開MobaXterm ,找到Packages,

image.png

右鍵粘貼

image.png

界面如下:找到Git 安裝,并安裝直到提示成功

image.png

修改MobaXterm 主目錄保持路徑(即工程目錄)

注意:如果你沒有修改,默認路徑如下:
C:\Users\xxx\AppData\Local\Temp\Mxt203\tmp\home_Dell\

找到MobaXterm Table 中Settings,選擇Configuration

image.png

修改目錄如下,點擊OK

image.png

開始使用MobaXterm

點擊主界面 Start local terminal

image.png

執(zhí)行l(wèi)s,就可以查看基礎(chǔ)生產(chǎn)文件

image.png

下面就可以執(zhí)行g(shù)it clone

image.png

注意:username,password,這里github 在2020以后就無法使用賬號密碼登錄,

這里請輸入用戶賬號,密碼要使用Token 登錄,然后就是正常使用命令

image.png

申請Token 官方指導(dǎo)

  1. Verify your email address, if it hasn't been verified yet.

  2. In the upper-right corner of any page, click your profile photo, then click Settings.

image.png
  1. In the left sidebar, click Developer settings.

  2. In the left sidebar, click Personal access tokens.

image.png
  1. Click Generate new token.
image.png
  1. Give your token a descriptive name.
image.png
  1. To give your token an expiration, select the Expiration drop-down menu, then click a default or use the calendar picker.
image.png
  1. Select the scopes, or permissions, you'd like to grant this token. To use your token to access repositories from the command line, select repo.
image.png
  1. Click Generate token.

image.png

image.png

10 . To use your token to authenticate to an organization that uses SAML single sign-on, authorize the token. For more information, see "Authorizing a personal access token for use with SAML single sign-on" in the GitHub Enterprise Cloud documentation.

Using a token on the command line

Once you have a token, you can enter it instead of your password when performing Git operations over HTTPS.

For example, on the command line you would enter the following:

$ git clone https://github.com/username/repo.git
Username: your_username
Password: your_token

Personal access tokens can only be used for HTTPS Git operations. If your repository uses an SSH remote URL, you will need to switch the remote from SSH to HTTPS.

If you are not prompted for your username and password, your credentials may be cached on your computer. You can update your credentials in the Keychain to replace your old password with the token.

Instead of manually entering your PAT for every HTTPS Git operation, you can cache your PAT with a Git client. Git will temporarily store your credentials in memory until an expiry interval has passed. You can also store the token in a plain text file that Git can read before every request. For more information, see "Caching your GitHub credentials in Git."

配置SSH key:

  1. git config --global user.name "xxxx"
    ?

  2. git config --global user.email "xxx@qq.com"

  3. ssh-keygen -t rsa -C "xx@qq.com"
    4 . cd ~/.ssh

  4. cat id_rsa.pub


    image.png
image.png

多賬號配置

git config --global user.name "UserXXX"
git config --global user.email "UserXXX@qq.com"

ssh-keygen -t rsa -C "xxx@qq.com"

這里輸入生產(chǎn)后文件

Generating public/private rsa key pair.
Enter file in which to save the key (/home/mobaxterm/.ssh/id_rsa): /home/mobaxterm/.ssh/id_rsaUserXXX
image.png
Host UserXXX
     HostName github.com
     PreferredAuthentications publickey
     IdentityFile ~/.ssh/id_rsaUserXXX

Host UserXXX
     HostName github.com
     PreferredAuthentications publickey
     IdentityFile ~/.ssh/id_rsaUserXXX

查看ssh
cat id_rsaUserXXX.pub

image.png

ssh -T git@UserXXX

image.png
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容