MobaXterm 下载地址:
https://mobaxterm.mobatek.net/download.html
本人使用的版本:https://wwn.lanzouv.com/iVewO09wiqfg
MobaXterm 下载Git步棸
打开MobaXterm ,找到Packages,
右键粘贴
界面如下:找到Git 安装,并安装直到提示成功
修改MobaXterm 主目录保持路径(即工程目录)
注意:如果你没有修改,默认路径如下:
C:\Users\xxx\AppData\Local\Temp\Mxt203\tmp\home_Dell\
找到MobaXterm Table 中Settings,选择Configuration
修改目录如下,点击OK
开始使用MobaXterm
点击主界面 Start local terminal
执行ls,就可以查看基础生产文件
下面就可以执行git clone
注意:username,password,这里github 在2020以后就无法使用账号密码登录,
这里请输入用户账号,密码要使用Token 登录,然后就是正常使用命令
申请Token 官方指导
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
多账号配置
git config --global user.name "UserXXX"
git config --global user.email "UserXXX@qq.com"
ssh-keygen -t rsa -C "xxx@qq.com"
这里输入生产后文件
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