使用MobaXterm 加载GIT,并下载项目

MobaXterm 下载地址:

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

MobaXterm 下载Git步棸

打开MobaXterm ,找到Packages,

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

执行ls,就可以查看基础生产文件

image.png

下面就可以执行git clone

image.png

注意:username,password,这里github 在2020以后就无法使用账号密码登录,
这里请输入用户账号,密码要使用Token 登录,然后就是正常使用命令
image.png

申请Token 官方指导

  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 "[email protected]"

  3. ssh-keygen -t rsa -C "[email protected]"
    4 . cd ~/.ssh

  4. cat id_rsa.pub


    image.png
image.png

多账号配置

git config --global user.name "UserXXX"
git config --global user.email "[email protected]"

ssh-keygen -t rsa -C "[email protected]"

这里输入生产后文件

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

你可能感兴趣的:(使用MobaXterm 加载GIT,并下载项目)