MobaXterm 下載地址:
https://mobaxterm.mobatek.net/download.html
本人使用的版本:https://wwn.lanzouv.com/iVewO09wiqfg
MobaXterm 下載Git步棸
打開MobaXterm ,找到Packages,
右鍵粘貼
界面如下:找到Git 安裝,并安裝直到提示成功
修改MobaXterm 主目錄保持路徑(即工程目錄)
注意:如果你沒有修改齿拂,默認(rèn)路徑如下:
C:\Users\xxx\AppData\Local\Temp\Mxt203\tmp\home_Dell\
找到MobaXterm Table 中Settings,選擇Configuration
修改目錄如下古劲,點(diǎn)擊OK
開始使用MobaXterm
點(diǎn)擊主界面 Start local terminal
執(zhí)行l(wèi)s,就可以查看基礎(chǔ)生產(chǎn)文件
下面就可以執(zhí)行g(shù)it clone
注意:username,password,這里github 在2020以后就無法使用賬號(hào)密碼登錄璃哟,
這里請(qǐng)輸入用戶賬號(hào)氛琢,密碼要使用Token 登錄,然后就是正常使用命令
申請(qǐng)Token 官方指導(dǎo)
Verify your email address, if it hasn't been verified yet.
In the upper-right corner of any page, click your profile photo, then click Settings.
In the left sidebar, click Developer settings.
In the left sidebar, click Personal access tokens.
- Click Generate new token.
- Give your token a descriptive name.
- To give your token an expiration, select the Expiration drop-down menu, then click a default or use the calendar picker.
- 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.
- Click Generate token.
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:
git config --global user.name "xxxx"
?git config --global user.email "xxx@qq.com"
ssh-keygen -t rsa -C "xx@qq.com"
4 . cd ~/.ssh-
cat id_rsa.pub
多賬號(hào)配置
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
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
ssh -T git@UserXXX