8: Pulling From A Remote Repo(Git Remotes)

Now that we reverted our local chatbot repo to an older version, the remote repo actually has a newer commit than our local repo. This happens often in projects when other people make changes to code, and push it to a remote repo. Here's a diagram showing which commits exist in which locations:

RemoteLocalc12c12README.mdREADME.mdThisisaThisisaREADME.README.c53README.mdThisisthebestREADME!

In cases where the latest commit in your local repo is older than the latest commit in the remote repo, you can use git pull to update the current branch with the latest commits. git pull will also update your working directory to have the same files as the latest commit.

In our case, we'll be updating the masterbranch, since the chatbot repo only has a single branch.

Instructions

  • Pull the latest commits from the chatbot remote repo.
  • Inspect the working directory and git history to see what happened

 

/home/dq/chatbot$ cd /home/dq/chatbot                                           

/home/dq/chatbot$ git pull                                                      

Updating 812c59f..71977ec                                                       

Fast-forward                                                                    

 README.md | 2 +-                                                               

 1 file changed, 1 insertion(+), 1 deletion(-)                                  

转载于:https://my.oschina.net/RobertPattins/blog/746973

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值