Questions tagged [rugged]

Ruby open source bindings for libgit2, a native git library

Rugged is a library for accessing libgit2 in Ruby. It gives you the speed and portability of libgit2 with the beauty of the Ruby language.

Rugged gives you access to the many parts of a Git repository. You can read and write objects, walk a tree, access the staging area, and lots more.

Online resources

64 questions
63
votes
6 answers

An error occurred while installing rugged

Following this tutorial [link] to install gitlab on a dedicated server. I need to : sudo -u git -H bundle install --deployment --without development test postgres aws But an error occurred while installing rugged…
plieb
  • 899
  • 1
  • 9
  • 23
8
votes
4 answers

Do GitHub and GitLab support git clone's --filter parameter?

I want to use git's partialClone feature. In this answer I saw the git clone --filter=tree:none command. But when trying to execute on github, the prompt warning: filtering not recognized by server, ignoring. It did not work. I want to know…
Ph0rse
  • 83
  • 6
7
votes
2 answers

Example of a git push using either rugged or grit

I'm looking for some code examples, for either rugged or grit, showing how to do a git push. Background I have rake tasks deploy:staging and deploy:production that I use to deploy my app. I'm deploying to heroku, so these tasks essentially do the…
Scott
  • 1,328
  • 1
  • 13
  • 21
6
votes
1 answer

How to create a git repository in memory?

I am currently working on a flashcard application where decks created by the user act as Git repositories. When a card is created in the app, a new file is committed to the repository, when a card is changed, the file is changed, and when a card is…
birdoftheday
  • 736
  • 5
  • 13
6
votes
1 answer

How to programmatically create a commit with Rugged?

I am trying to programmatically create a commit to an existing repository using Rugged (the Ruby binding of libgit2). I have tried to follow the documentation provided in the Rugged README, but I think it doesn't quite match up with the current…
jbranchaud
  • 5,439
  • 8
  • 42
  • 69
5
votes
4 answers

How do I use rugged to check if there are uncommited changes in my git repository?

How do I use rugged to check whether there are uncommitted changes in my git repo? Much like How do I programmatically determine if there are uncommited changes?
zlog
  • 3,286
  • 3
  • 39
  • 78
4
votes
2 answers

Rugged - fetch, pull rebase possible?

Using rugged how do you perform the following operations: fetch, pull and rebase? I am using the development branch and after reviewing its documentation found here as a guide to the Remote class. EDIT: Since git pull is just a shorthand for git…
rhodee
  • 1,227
  • 1
  • 14
  • 27
3
votes
1 answer

How to pull git repository using Rugged ruby gem

How do I pull changes from remote repo using Rugged ruby gem. Most of question on this topic are outdated as api has changed. I am using a simple repo with nothing complex. I found below code on one of the stackoverflow question but unfortunately…
Robert
  • 31
  • 1
3
votes
1 answer

Can't clone repository with Rugged

Using openSUSE and Ubuntu with installed dependencies I can't clone the remote repository with Rugged::Repository.clone_at method and getting the error message: Rugged::NetworkError: This transport isn't implemented. Sorry The code: credentials =…
vmoravec
  • 73
  • 6
3
votes
1 answer

comparing 2 commits in rugged

I didn't find any documentation on getting the difference between 2 files in rugged. I used the below code to commit a file using rugged @repo=Rugged::Repository.new($reponame) @sha=@repo.write('D:\Ruby\MyGitRepo\file1.txt','blob') puts @sha commit…
Ahmad Osama
  • 81
  • 1
  • 10
3
votes
1 answer

get the latest commit where a file changed

My task at hand is to figure out, what is the commit id of the last commit, where a specific file changed. I'm using ruby / rugged. The only solution I came up with is to walk over all commits, search for the file in the tree associated with the…
Torsten Robitzki
  • 2,939
  • 18
  • 34
2
votes
1 answer

Implement git branch --contains with rugged library

I'm working with a ruby script that execute the following git command on a given git repository. branches = `git branch -a --contains #{tag_name}` This approach has some drawbacks with command output (that may change in different git versions)…
Fabio
  • 17,633
  • 9
  • 76
  • 110
2
votes
0 answers

How to get a git repository's default branch in Ruby's "rugged" gem?

Related to git - how to get default branch? I'm trying to port a Bash script to Ruby. The script uses git symbolic-ref --short HEAD to get a repo's default branch. Is there a way to combine rugged's repo.branches.each_name(:local) with some other…
Katrin Leinweber
  • 964
  • 9
  • 24
2
votes
1 answer

Is there a 'git cherry' in libgit2

I'm working on a project and one of the requirements is the need to call git cherry command to get some differences between on branch and the other - (note this is not git cherry-pick). I was planning to use ruby rugged gem for this project but I…
RobisonSantos
  • 575
  • 4
  • 16
2
votes
2 answers

How to select the appropriate diff /patch for a commit with rugged

I try to get the commits that have been done after a date in a local copy of a git repo and then extract the related modifications on the files. If I would like to compare this to a git command, It would be : git log -p --reverse…
cedlemo
  • 2,946
  • 2
  • 25
  • 45
1
2 3 4 5