git git 查看远程库

Note: This the fourth video in the Git for beginners series. Watch the first video here.

注意:这是Git初学者系列的第四个视频。 在这里观看第一个视频 。

When you make a change to a local repository, you can push a change to a Git remote repository. Likewise, when the remote gets changed, you can pull the changes back to your local repository.

对本地存储库进行更改时,可以将更改推送到Git远程存储库。 同样,在更改远程服务器后,您可以将更改拉回到本地存储库。

Today, you’ll learn how to do the pull from the remote back to your repository.

今天,您将学习如何从远程拉回到存储库。

更改遥控器 (Making a change to the remote)

Usually, another person working on the same project makes a change to the remote. They change the code on their computer, and they push it to the remote repository.

通常,在同一项目上工作的另一个人可以更改遥控器。 他们在计算机上更改代码,然后将其推送到远程存储库。

Once the remote repository changes, you can pull it back to your local repository to get the updated version.

远程存储库更改后,可以将其拉回到本地存储库以获取更新的版本。

That’s the standard workflow.

这是标准的工作流程。

But, since I’m working on the project alone, I’m going to show you how to change the remote repository directly on GitHub. Once we’re done, we’ll pull from there.

但是,由于我仅在开发项目,因此我将向您展示如何直接在GitHub上更改远程存储库。 一旦完成,我们将从那里拉。

直接更改GitHub存储库 (Changing the GitHub repository directly)

Let’s say we want to change the README.md text.

假设我们要更改README.md文本。

To do so, you can click on the pencil icon beside the Readme file. This brings you to an editor where you can change the text.

为此,您可以单击自述文件旁边的铅笔图标。 这将带您进入编辑器,您可以在其中更改文本。

Once you’re done, scroll down to the bottom and write a commit message. You can click on the green button to commit the changes directly on GitHub.

完成后,向下滚动至底部并编写提交消息。 您可以单击绿色按钮直接在GitHub上提交更改。

The project will be updated.

该项目将被更新。

取得变更 (Fetching changes)

Fork and other Git clients can show you the changes to a remote repository. They do it through a command called Git Fetch.

Fork和其他Git客户端可以向您显示对远程存储库的更改。 他们通过称为Git Fetch的命令来完成此操作。

You can do a Fetch yourself by clicking on the empty arrow that points downwards. It’s the leftmost arrow button on the top left-hand corner

您可以通过单击向下的空箭头来自己进行访存。 这是左上角的最左箭头按钮

Fetch checks the remote repository for any changes. It’s like an email client that says you have three emails to read.

Fetch检查远程存储库是否有任何更改。 这就像一个电子邮件客户端,说您有三封电子邮件要阅读。

Once the Fetch finishes, you can see in the Git history that origin/master is on the update README.md commit. The update README.md commit is one commit ahead of our local master branch.

提取完成后,您可以在Git历史记录中看到origin/masterupdate README.md提交上。 update README.md提交是本地master分支之前的一项提交。

On the sidebar, you can see the number 1 beside our master branch, and an arrow that points downwards. This tells us our branch is one commit behind the remote.

在侧栏上,您可以看到我们的主分支旁边的数字1,以及一个向下的箭头。 这告诉我们我们的分支是遥控器后面的一个提交。

拉动变化 (Pulling changes)

To update your local branch, you can click on the pull button. The pull button is the filled downwards arrow at the top left-hand corner. It’s the one between Fetch and Push.

要更新您的本地分支机构,您可以单击下拉按钮。 下拉按钮是左上角的向下填充箭头。 这是Fetch和Push之间的一种。

When you click on Pull, you’ll be able to select the branch you want to pull. Since we have tracked it previously, you can pull the master branch directly by clicking pull again.

单击“拉”时,您可以选择要拉的分支。 由于我们之前已经跟踪过它,因此可以通过再次单击“拉”来直接拉出master分支。

When you pull the branch from the remote to your local repository, you’ll see that master moves up to the same commit as origin/master.

当您从远程将分支拉到本地存储库时,您会看到master移至与origin/master相同的提交。

结语 (Wrapping up)

Fetch checks if there are any changes in the remote repository.

提取检查远程存储库中是否有任何更改。

Pull brings the changes from the remote repository to your local repository.

Pull将更改从远程存储库带到本地存储库。

Thanks for reading. Did this article help you in any way? If you did, I hope you consider sharing it. You might help someone out. Thank you!

谢谢阅读。 本文对您有任何帮助吗? 如果这样做, 希望您考虑共享它 。 您可能会帮助某人。 谢谢!

This article was originally posted at my blog. Sign up for my newsletter if you want more articles to help you become a better front-end developer.

本文最初发布在我的博客上 。 如果您想要更多文章来帮助您成为更好的前端开发人员,请注册我的新闻通讯 。

翻译自: https://www.freecodecamp.org/news/how-to-pull-from-a-git-remote-repository-b9fabb6b3c9d/

git git 查看远程库

git git 查看远程库_如何从Git远程存储库中提取相关推荐

  1. Git学习笔记 -- 安装git、创建版本库、时光穿梭、远程仓库

    一.Git的安装 在window系统上安装:从https://git-for-windows.github.io下载,然后按默认选项安装即可: 安装完成后,在"桌面"上右击,在弹出 ...

  2. Git第六章:1.如何创建Github远程库、如何为远程库创建别名、如何推送本地库至github远程库、如何将github远程库拉取至本地库

    一.创建github远程库 创建github远程库步骤: 1.登录github 2.右上角的 + 3.选择 new repository,新建仓库 4.正常选择,仓库名称,直接创建即可,然后就是经典的 ...

  3. a commit git 参数是什么意思_深入理解Git - 一切皆commit

    在对 git 有了基本理解和知道常规操作之后,如何对 git 的使用有进一步的理解? 一切皆 commit 或许是个不错的理解思路. 本文将从『一切皆 commit 』的角度,通过 git 中常见的名 ...

  4. .git文件夹_将Git存储库中的文件夹转换为全新的存储库

    前提 如果您创建存储库的新克隆,则在将文件夹拆分到单独的存储库时,不会丢失任何Git历史记录或更改. 步骤 打开终端. 将当前工作目录更改为要创建新存储库的位置. 克隆包含子文件夹的存储库. $ gi ...

  5. git 初始化git存储库_什么不保存到Git存储库中

    git 初始化git存储库 You should not commit these four types of files into your Git repository. 您不应将这四种类型的文件 ...

  6. 如何仅从git存储库中稀疏签出单个文件?

    如何从git仓库中检出一个文件? #1楼 git checkout branch_or_version-路径/文件 示例: git checkout HEAD -- main.c #2楼 如果您已经有 ...

  7. 将子目录分离(移动)到单独的Git存储库中

    我有一个Git存储库,其中包含许多子目录. 现在,我发现一个子目录与另一个子目录无关,应该将其分离到单独的存储库中. 如何在保留子目录中文件历史记录的同时执行此操作? 我想我可以制作一个克隆并删除每个 ...

  8. 如何从 Git 存储库中删除文件?

    问: 如何从我的存储库中删除 "file1.txt"? 答1: huntsbot.com – 程序员副业首选,一站式外包任务.远程工作.创意产品分享订阅平台. 使用 git rm. ...

  9. git-secret:在 Git 存储库中加密和存储密钥(下)

    在之前的文章中(点击此处查看上一篇文章),我们了解了如何识别包含密钥的文件,将密钥添加到 .gitignore ,通过 git-secret 进行加密,以及将加密文件提交到存储库.在本篇文章中,将带你 ...

最新文章

  1. webSocket详解
  2. Qt编写网络调试助手(TCP客户端+TCP服务端+UDP服务端)终极版开源
  3. java is number_数据类型----Number
  4. MYSQL 添加外键报错
  5. cas引出的ABA问题?如何解决?- 理解原子引用、时间戳(版本号)原子引用
  6. CoreLocation框架--监测方向/地磁传感器
  7. 长宽相等的矩阵(二维数组)逆时针旋转90度
  8. TEMU:动态分析组件
  9. CSS中的Position、Float属性的一些深入探讨
  10. 每天CookBook之Python-004
  11. 【AIX】用户、组合安全管理
  12. FFmpeg总结(十三)用ffmpeg基于nginx实现直播功能,不用第三方SDK,自研推流拉流
  13. Layui 文档(含镜像站资源)
  14. 《个人信息保护法》正式施行,拒绝隐私泄露
  15. PL.SQL.Developer.v9.0.1.1613下载地址
  16. AI(人工智能:一种现代的方法)学习之:基于信息的搜索策略(informed search)——启发式(heuristic)搜索、贪婪(greedy)搜索、A* (A star)搜索
  17. Aryaka荣获2016年度全球最具影响力SD-WAN解决方案奖
  18. Intellij IDEA中修改Maven项目的项目名称
  19. 三峡学院计算机调剂,重庆三峡学院2019考研预调剂公告
  20. iphone 存图片和视频到iPhone相册

热门文章

  1. 【OpenGL】理解GL_TRIANGLE_STRIP等绘制三角形序列的三种方式
  2. 理解流 java 0325
  3. 自定义日期工具类 java 1614698552
  4. 新建一个java程序并运行
  5. 演练 开心庄园 1002
  6. django 路由分发 url分层
  7. 用户访问一个网站的全部过程
  8. 远程访问数据库出错的解决办法
  9. Windows10 家庭版安装Docker
  10. AWS再迎大师加盟:Java之父James Gosling决定效力