1.很多服务器都是需要认证的,ssh认证是其中的一种。在客户端生成公钥,把生成的公钥添加到服务器,你以后连接服务器就不用每次都输入用户名和密码了。
2.很多git服务器都是用ssh认证方式,你需要把你生成的公钥发送给代码仓库管理员,让他给你添加到服务器上,你就可以通过ssh自由地拉取和提交代码了。
ssh-keygen -t rsa -C "邮箱地址"
$ cd ~/.ssh
$ ls
authorized_keys2 id_dsa known_hosts
config id_dsa.pub
1. ssh root@服务器
2. 关闭远程连接输入指令:exit
上传文件:scp 本地文件路径 用户名@服务器ip:目标路径
上传文件夹:scp -r 本地文件夹路径 用户名@服务器ip:目标路径
4. scp下载文件,scp 用户名@服务器ip:文件路径 本地文件路径
5. scp下载文件夹,scp -r 用户名@服务器ip:文件夹路径 本地文件夹路
附:利用Filezilla进行文件上传、下载
相关播客:
https://help.github.com/en/articles/connecting-to-github-with-ssh
https://git-scm.com/book/zh/v2/服务器上的-Git-生成-SSH-公钥
git branch new #创建
git checkout new #移动到new 分支
git checkout -b new #master 从master上创建分支并检出到该分支
git merge new # 在其他分支上合并new分支
# 分支切换
git branch
git checkout master
git init
git add your_file
git commit -m ""
git remote add origin your_github地址
git push -u origin master 上面命令将本地的master分支推送到origin主机,同时指定origin为默认主机,后面就可以不加任何参数使用git push了
git push -f origin master # 强制推送
$ git tag v1.0
$ git tag
原文:https://www.cnblogs.com/rainbowbridge/p/12244566.html