![rsync 排除git](https://i-blog.csdnimg.cn/blog_migrate/0704394a061699b1828c5b5f55ca6cdf.png)
rsync 排除git
I have a remote repository which is Git. I want to connect to Git over ssh because there are problems with the firewall rules in our work environment. How can use ssh to connect remotely to Git with specifying ssh keys for this Git operations.
我有一个远程存储库,它是Git。 我想通过ssh连接到Git,因为我们的工作环境中的防火墙规则存在问题。 如何通过ssh通过为此Git操作指定ssh密钥来远程连接到Git。
使用ssh-agent (Using ssh-agent)
ssh-agent will create and temprorary environment where tkey is added with ssh-add command into the shell. After environment is completed git operations can be done where git will use current ssh keys to connect remotely with ssh tunnel. Keep in mind the keys will be lost after commands are completed
ssh-agent将创建一个临时环境,在该环境中,使用ssh-add命令将tkey添加到外壳中。 环境完成后,可以执行git操作,其中git将使用当前的ssh密钥与ssh隧道远程连接。 请记住,命令完成后按键会丢失
ssh-agent $(ssh-add /home/ismail/ssh_keys/ismail; \
git clone [email protected]:ibaydan/dev.git)
使用主机配置 (With Host Configuration)
Another way to connect remote Git Repository over ssh is using ssh configuration files to specify IdentityFile like below
通过ssh连接远程Git存储库的另一种方法是使用ssh配置文件来指定IdentityFile,如下所示
Host github.com
IdentityFile ~/.ssh/github_rsa
This will work too. When connecting to github.com specified IdentityFile will be used by ssh.
这也将起作用。 当连接到github.com时,ssh将使用IdentityFile 。
如何在运行Shell命令(如Git,Rsync Infografic)时指定Ssh键 (How To Specify Ssh Keys When Running Shell Command Like Git,Rsync Infografic)
![How To Specify Ssh Keys When Running Shell Command Like Git,Rsync](https://i-blog.csdnimg.cn/blog_migrate/4993db7b504d17fe590f6f90404277a3.png)
翻译自: https://www.poftut.com/specify-ssh-keys-running-shell-command-like-gitrsync/
rsync 排除git