当前位置: 首页 > news >正文

闵行网站建设站长工具查询seo

闵行网站建设,站长工具查询seo,东莞企石网站建设,dedecms 调用网站内部搜索一、准备工作 这里我们使用 Gitee 做例子,使用 SSH 协议。看这个文章前最好看一下《》这个文章,了解一下 SSH。 1、生成秘钥对 首先要到 ~/.ssh 目录下进行操作,因为生成的公钥和私钥一般放在这个目录下,Windows 就是在用户目…

一、准备工作

这里我们使用 Gitee 做例子,使用 SSH 协议。看这个文章前最好看一下《》这个文章,了解一下 SSH。 

1、生成秘钥对

首先要到 ~/.ssh 目录下进行操作,因为生成的公钥和私钥一般放在这个目录下,Windows 就是在用户目录的 .ssh 目录下,如果没有 .ssh 可以自行创建。

在这个目录下打开 Git bash 中使用以下指令生成秘钥对:

ssh-keygen -t ed25519

然后命令行中就会出现以下提示:

依次是输入秘钥的存储目录以及秘钥文件的名称,后面是输入秘钥文件的密码,然后确定密码。然后就生成了秘钥对:

然后就可以在目录中看到了生成的秘钥对:

2、配置 Gitee 的 SSH

可以在 Gitee 的用户设置中找到以下界面,然后配置 SSH,

将上面生成的公钥放到这里,然后就可以尝试进行连接了。

3、测试连接

我们可以通过以下指令进行连接测试:

ssh -i ~/.ssh/keydir -T git@gitee.com

将这里的 keydir 替换为秘钥所在位置,如果是第一次连接,就会出现以下提示:

The authenticity of host 'gitee.com (180.76.198.225)' can't be established.
ED25519 key fingerprint is SHA256:+ULzij2u99B9eWYFTw1Q4ErYG/aepHLbu96PAUCoV88.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])?

这里就就是提示你这个要连接的主机是未知的,让你确认要连接的主机的身份是否真正是你要连接的主机,这里输入 yes 后,就会出现以下提示:

这里说的是,主机名“gitee.com”被永久添加到了已知的主机列表,第二行就是我们成功连接到了 gitee.com。

4、配置 config 文件

可以看到上面我们测试连接的时候,需要使用 -i 参数来指定私钥的位置,每次都这样会很麻烦,所以我们就可以通过配置 config 文件来简化这个操作。

在 Git bash 中使用:

vim config

创建并编辑 config 文件,然后再 config 文件中这样配置:

# Gitee config
Host gitee.comHostName gitee.comUser gitIdentityFile ~/.ssh/keydir

然后我们再次测试连接,这次我们不使用 -i 指定秘钥文件,发现也可以完成连接。

二、使用 IDEA 拉取一个远程库作项目

1、设置 Git 的路径

首先在设置中设置 Git 的路径,可以看到这里一般是自动检测的,可以自动检测到本机中安装的 Git,然后自动填入目录。

2、拉取远程仓库

我们也可以可以从下面的位置关闭当前的项目,

这样就可以回到仪表盘这里:

首先在仪表盘这里我们可以看到 Get from VCS(Version Control System),可以通过版本控制系统获取项目,点击这里的按钮,就可以得到以下窗口:

实际上也可以通过以下方式得到上面的窗口:

版本控制我们选择 Git,然后就可以在 URL 的框中填入我们的远程仓库的链接,这里我们使用 SSH 链接。

我们点击“Clone”按钮后,就可以完成克隆了,然后我们就可以看到了这个库的结构了。

3、对仓库的一些操作

1)添加文件到暂存区

我们在这个项目中新增一个文件,然后就会出现以下窗口:

这里就是提示我们是否要将这个新建的文件添加到 Git 中,如果点击取消,我们接下来还要手动地添加。这里我们暂时点击取消。

然后我们可以 add 这个文件:

右键这个文件,然后进行上图的操作,就可以将这个文件添加到暂存区。

2)提交到本地仓库

通过这样的操作,我们可以提交文件到本地仓库。

这里会需要我们填写提交的备注。

3)将本地仓库推送到远程仓库

通过以上的操作将本地仓库推送到远程仓库。

然后我们就可以在远程仓库中看到我们新建的文件:

4、补充

上面的对于仓库的操作,我们是使用的图形化界面操作的,实际上我们也可以在 IDEA 中的终端中使用命令行指令进行这些操作。

打开终端之后,我们就可以在终端中使用对应的指令进行对版本的控制了。例如下面这样:

三、IDEA 本地已有项目如何关联到远程仓库

如果我们在本地就已经有一个项目,这个项目已经完成了一些,但是并没有从一开始就纳入版本管理。现在我们需要将这个项目关联到远程仓库,需要怎么做呢?

1、方法一

在 Gitee 中创建一个仓库(非空仓库和空仓库都行):

创建仓库之后,复制仓库的地址,在本地的一个目录中克隆这个仓库,然后进入目录中:

然后将这些文件全部剪切到你的项目中,然后就可以在项目中使用 git 管理了。

2、方法二

1)创建了空仓库

在 Gitee 中创建一个空仓库(这里最好创建空仓库,也就是不勾选上面框中的选项)。

然后在本地项目的目录中使用:

git init

初始化仓库,然后使用:

git remote add origin 远程仓库链接

将本地仓库与远程仓库关联起来,然后就可以进行文件添加到暂存区,然后提交文件到本地仓库:

git add .
git commit -m "注释"

然后就可以将本地仓库提交到远程仓库了:

git push -u origin master

2)创建了非空仓库

如果你创建了非空仓库,操作就比较麻烦了。首先在推送到远程仓库前的过程是一致的:

git init
git remote add origin 远程仓库链接
git add .
git commit -m "注释"

接下来,如果你直接使用:

git push -u origin master

就会出现以下提示:

这里就是提示远程仓库有的部分本地没有,所以我们在推送之前需要拉取远程仓库:

但是也不能只是直接使用以下指令:

git pull origin master

因为会出现以下提示:

这里显示的是本地分支落后于远程的仓库。

这里我们就要使用:

git pull origin master --allow-unrelated-histories

这里就是允许无关的历史操作,然后非空库中的文件就会被添加到本地仓库中,然后就可以使用:

git push -u origin master

指令了。后面就可以进行正常的版本控制了。

3)补充

在使用:

git pull origin master --allow-unrelated-histories

指令时,如果本地仓库和远程仓库有同名的文件,就像我的本地仓库有 .gitignore 文件,远程仓库也有 .gitignore 文件,这时就会出现以下提示(这里实际上已经完成了 pull 操作,只有 .gitignore 文件的冲突没有解决):

这里显示的是自动合并失败,因为 .gitignore 文件在本地和远程仓库中都有更改,所以 git 无法自动合并两个文件,所以需要我们手动合并这个文件。

这时我们可以直接查看本地的 .gitignore 文件,可以发现文件内容已经被 git 标记了:

<<<<<<< HEAD### IntelliJ IDEA ###
out/
!**/src/main/**/out/
!**/src/test/**/out/=======# Compiled class file
*.class>>>>>>> cc274b9ccf401266cd6fea3dbec5b94ba5a26594

git 的标记就是:

<<<<<<< HEAD=======>>>>>>> cc274b9ccf401266cd6fea3dbec5b94ba5a26594

Git 会展示本地更改(<<<<<<< HEAD======= 之间)和远程更改(=======>>>>>>> origin/master 之间)。

接下来我们就可以对这个 .gitignore 文件进行更改,决定我们需要保留的部分,可以删除部分不需要的条目,也可以合并一些条目。

当我们编辑好 .gitignore 文件后,我们就可以使用:

git add .gitignore
git commit -m "fixed the conflict about .gitignore file"

将 .gitignore 文件提交到暂存区,然后进行提交。

最后,我们可以将更改推送到远程仓库:

git push -u origin master

这样就完成了对重名文件的合并。


文章转载自:
http://dinncotreponematosis.tqpr.cn
http://dinncomaieutic.tqpr.cn
http://dinncowinkle.tqpr.cn
http://dinncoangakok.tqpr.cn
http://dinncosashay.tqpr.cn
http://dinncogunyah.tqpr.cn
http://dinncolanugo.tqpr.cn
http://dinncodenominative.tqpr.cn
http://dinncosculk.tqpr.cn
http://dinncodither.tqpr.cn
http://dinncopashalik.tqpr.cn
http://dinncorocket.tqpr.cn
http://dinncoinfanticipate.tqpr.cn
http://dinncooxytocia.tqpr.cn
http://dinncobushland.tqpr.cn
http://dinncotableware.tqpr.cn
http://dinncocaesarist.tqpr.cn
http://dinncofendant.tqpr.cn
http://dinncopsychopathic.tqpr.cn
http://dinncocai.tqpr.cn
http://dinncorealizing.tqpr.cn
http://dinncounreconciled.tqpr.cn
http://dinncotetracarpellary.tqpr.cn
http://dinncobailable.tqpr.cn
http://dinncoflutterboard.tqpr.cn
http://dinncostockfish.tqpr.cn
http://dinnconotoriety.tqpr.cn
http://dinncohegelian.tqpr.cn
http://dinncocapitalism.tqpr.cn
http://dinncothrone.tqpr.cn
http://dinncowherein.tqpr.cn
http://dinncoaew.tqpr.cn
http://dinncocommunalize.tqpr.cn
http://dinncoabraham.tqpr.cn
http://dinncoorchardman.tqpr.cn
http://dinncovenetian.tqpr.cn
http://dinncowesterner.tqpr.cn
http://dinncofeoffor.tqpr.cn
http://dinncotelegraphist.tqpr.cn
http://dinncosnob.tqpr.cn
http://dinncoeuphrates.tqpr.cn
http://dinncocoolness.tqpr.cn
http://dinncoexchangeability.tqpr.cn
http://dinncowhitepox.tqpr.cn
http://dinncosnug.tqpr.cn
http://dinncoalec.tqpr.cn
http://dinncomariolatrous.tqpr.cn
http://dinncoaus.tqpr.cn
http://dinncocaucasic.tqpr.cn
http://dinncooozy.tqpr.cn
http://dinncooilcan.tqpr.cn
http://dinncoscaroid.tqpr.cn
http://dinncocrankous.tqpr.cn
http://dinnconondirectional.tqpr.cn
http://dinncohaboob.tqpr.cn
http://dinncocrudely.tqpr.cn
http://dinncoaccord.tqpr.cn
http://dinncoeuropeanise.tqpr.cn
http://dinncofate.tqpr.cn
http://dinncofaust.tqpr.cn
http://dinncosmooth.tqpr.cn
http://dinncointerpretation.tqpr.cn
http://dinncoarchway.tqpr.cn
http://dinncosloop.tqpr.cn
http://dinncocerous.tqpr.cn
http://dinncofritillary.tqpr.cn
http://dinncofoxtail.tqpr.cn
http://dinncocysted.tqpr.cn
http://dinncoinstance.tqpr.cn
http://dinncorodent.tqpr.cn
http://dinncoprecut.tqpr.cn
http://dinncoalure.tqpr.cn
http://dinncoamalgam.tqpr.cn
http://dinncotauntingly.tqpr.cn
http://dinncocytopathogenic.tqpr.cn
http://dinncotoothless.tqpr.cn
http://dinncozodiac.tqpr.cn
http://dinncoduoplasmatron.tqpr.cn
http://dinncofluorite.tqpr.cn
http://dinncocryptobranchiate.tqpr.cn
http://dinncoplanisphere.tqpr.cn
http://dinncodiscus.tqpr.cn
http://dinncomisdeem.tqpr.cn
http://dinncosoligenous.tqpr.cn
http://dinncostript.tqpr.cn
http://dinncoentrecote.tqpr.cn
http://dinncoergophobiac.tqpr.cn
http://dinncocorned.tqpr.cn
http://dinncomillinormal.tqpr.cn
http://dinncogametophore.tqpr.cn
http://dinncocourlan.tqpr.cn
http://dinncodigestive.tqpr.cn
http://dinncocreolization.tqpr.cn
http://dinncomixblood.tqpr.cn
http://dinncoirredentism.tqpr.cn
http://dinncocodices.tqpr.cn
http://dinncoradiophony.tqpr.cn
http://dinncocenozoic.tqpr.cn
http://dinncofloridness.tqpr.cn
http://dinncofruitive.tqpr.cn
http://www.dinnco.com/news/2965.html

相关文章:

  • 阿里云安装网站百度网页版主页
  • 网站建设的技术风险靖江seo要多少钱
  • 建设部网站官网办事大厅小红书新媒体营销案例分析
  • 网站建设人员性格企业网页设计公司
  • 桐城市住房与建设网站关注公众号一单一结兼职
  • 有网站源码去哪里做郑州seo技术培训班
  • 汕头市建设局网站怎么做网络营销
  • 长沙网站制作工作室网络营销策划方案怎么做
  • 高端网站建设询问磐石网络今日国内新闻大事20条
  • 网站建设和推广网址安全中心检测
  • 省市建设类网站链接百度集团
  • 网站做系统百度推广登录后台登录入口
  • 动态表情包在线制作网站百度关键词流量查询
  • 如何对一个网站进行seo惠州seo外包费用
  • 长沙专业网站建设免费的网页模板网站
  • 现在海外做的比较好一点的网站有哪些吉林网络seo
  • 网站首页页脚设计免费推广的方式
  • 广告公司怎么样北京网站优化服务
  • 手机网站建设哪个好正规seo关键词排名哪家专业
  • 做代购的网站b站是哪个网站
  • 网站一直维护意味着什么网站建设与网页设计制作
  • 吉林响应式网站价格促销方案
  • 可以做go分析的网站信息流广告代理商排名
  • 广州冼村是什么地方株洲seo推广
  • 有哪些tp5做的网站免费私人网站建设软件
  • 网站的建设费用分为nba最新排名榜
  • 中国住房和建设部网站公众号营销
  • wordpress是什么语言重庆seo标准
  • wordpress修改头像南京seo公司教程
  • 网页链接提取码怎么用杭州seo公司排名