Daniele Pallastrelli
Daniele Pallastrelli

Reputation: 2552

Git command from ruby

Why this Ruby code doesn't work? It's supposed to clone a git repository from a remote server.

pipe = IO.popen( 'git clone [email protected]:/prj/Common/git/MyProject', "w+"  )
pipe.puts 'mySecretPassword'
pipe.close_write

Thanks.

Upvotes: 0

Views: 782

Answers (2)

hernvnc
hernvnc

Reputation: 1025

I'd use a git wrapper for ruby such as this one. Makes everything simpler https://github.com/libgit2/rugged

Upvotes: 0

Hauleth
Hauleth

Reputation: 23566

I don't know why it's not working but if you want to work with Git repo in your Ruby app it's good idea to use one of Gems that provide API for Git (i.e. git).

Upvotes: 3

Related Questions