rugged icon indicating copy to clipboard operation
rugged copied to clipboard

Example of emulating git pull?

Open zeroedin opened this issue 9 years ago • 4 comments

Does anyone have a quick example they can share emulating a git pull using fetch and merge?

Struggling a bit trying to sift through the docs.

zeroedin avatar Jun 30 '16 22:06 zeroedin

Not sure if this is appropriate but seems to work for my use case:

repo.checkout(repo.branches["origin/master"], strategy: :force)

Edit: Spoke too soon, this did not work as I had intended. Still trying to understand how to clone a repo at master, then update aka pull changes to that cloned repo. Any help would be appreciated.

zeroedin avatar Jul 01 '16 14:07 zeroedin

A pull is a fetch and then a merge.

http://www.rubydoc.info/gems/rugged/0.24.0/Rugged/Remote#fetch-instance_method

Remote#fetch is what you're looking for.

DylanFrese avatar Aug 05 '16 20:08 DylanFrese

hi, did you solved the problem? I'm also want to know how to do git pull

talka123456 avatar May 28 '21 06:05 talka123456

This issue really deserves a proper answer.

mslinn avatar May 07 '23 02:05 mslinn