How can I pull another repository and update to its head in GIT?

Posted by mark on Stack Overflow See other posts from Stack Overflow or by mark
Published on 2012-10-31T16:57:38Z Indexed on 2012/10/31 17:00 UTC
Read the original article Hit count: 152

Filed under:

Here is the description of the problem in terms of Mercurial:

Given:

  • Two repos A and B, where B is a fork of A
  • The current directory is a working directory for the tip of A.

Needed:

  • Pull in B and update to its most recent head REV.

This is what I want to do in term of Mercurial:

A> hg pull B
A> hg heads         # Notice the most recent head of B
A> hg update **REV**

How can I do it in GIT? More concretely:

I know it should be trivial, still I cannot figure it out.

Anyone?

© Stack Overflow or respective owner

Related posts about git