Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function to document/set merge strategy #1955

Open
Aariq opened this issue Feb 29, 2024 · 1 comment
Open

Function to document/set merge strategy #1955

Aariq opened this issue Feb 29, 2024 · 1 comment
Labels
feature a feature request or enhancement git git, GitHub, and CI in general

Comments

@Aariq
Copy link

Aariq commented Feb 29, 2024

I think fairly recently git started requiring that you set one of three merge strategies before pulling when there are divergent branches:

hint: You have divergent branches and need to specify how to reconcile them.
hint: You can do so by running one of the following commands sometime before
hint: your next pull:
hint: 
hint:   git config pull.rebase false  # merge (the default strategy)
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint: 
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
fatal: Need to specify how to reconcile divergent branches

While these can be set with use_git_config(pull.rebase = "false"), for example, it might be nice to have a dedicated function for this. It could serve as 1) a place to document pros and cons of these choices and maybe suggest a default (I had a lot of trouble deciding which one to choose when I first encountered this message) and 2) provide easier to remember options like strategy = c("merge", "rebase", "fast-forward").

Also git_sitrep() should check if one of these options is set, which I don't think it currently does.

@Aariq Aariq changed the title Function to document set merge strategy Function to document/set merge strategy Feb 29, 2024
@jennybc
Copy link
Member

jennybc commented Mar 1, 2024

FWIW I'm a long-time happy user of:

[pull]
	rebase = true

I'm not really thinking about the git side of usethis right now, so it's hard to say if we'll wade this far into folks' git config. But I do think your Git life is happier if you make a conscious config choice here.

@jennybc jennybc added feature a feature request or enhancement git git, GitHub, and CI in general labels Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement git git, GitHub, and CI in general
Projects
None yet
Development

No branches or pull requests

2 participants