Skip to content

Add branch and tag to git_install() #255

@rkrug

Description

@rkrug

I would suggest to add a ref argument to the function install_git(), similar to the one in the install_github() to enable the installation of tagged versions or branches from a git repository.

As pointed out by Winston Chang (Conversation "ref parameter for install_git?" on the devtools mailing list), -b (or --branch) could used in git clone:

At the moment install_git_single uses

request <- system2(
    git_binary_path,
    args = c('clone', '--depth', '1', '--no-hardlinks', git_url,  bundle),
    stdout = FALSE, stderr = FALSE
  )

to clone the git repo.

request <- system2(
    git_binary_path,
    args = c('clone', '--branch = \"', ref, '\" ', '--depth', '1', '--no-hardlinks', git_url,  bundle),
    stdout = FALSE, stderr = FALSE
  )

i.e. adding the --branch = ... parameter, should work as expected.

Cheers,

Rainer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions