rugged
rugged copied to clipboard
Example of emulating git pull?
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.
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.
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.
hi, did you solved the problem? I'm also want to know how to do git pull
This issue really deserves a proper answer.