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

Avoiding committing unwanted files with use_git() #378

Closed
karawoo opened this issue May 31, 2018 · 4 comments
Closed

Avoiding committing unwanted files with use_git() #378

karawoo opened this issue May 31, 2018 · 4 comments
Labels
Milestone

Comments

@karawoo
Copy link

@karawoo karawoo commented May 31, 2018

I love that use_git() automatically puts .Rhistory, .RData, and .Rproj.user in .gitignore. Because it automatically commits everything else I often end up with other unwanted files in my git history, such as the ever-irritating .DS_Store. Would it be possible to gitignore this file by default as well (though that's potentially confusing for non-Mac users), or maybe for the user to have more control over what gets added to the initial commit?

@jennybc
Copy link
Member

@jennybc jennybc commented May 31, 2018

I think the traditional way for Mac users to prevent the .DS_Store problem is to list that in a user-level global gitignore file (I know I do).

But perhaps use_git() should be reigned in somehow, yes. I have also found it overzealous at times.

@jennybc
Copy link
Member

@jennybc jennybc commented May 31, 2018

Proposal:

  • If not interactive, continue to commit all files.
  • If interactive, ask user to choose:
    • Stage & commit all of <THESE FILES> with <THIS MESSAGE>?
    • Don't make an initial commit.

@hadley do you have an opinion?

@karawoo
Copy link
Author

@karawoo karawoo commented May 31, 2018

I like this. When I use use_git() I always expect it to do just the git init part and forget that it does the commit too, so it would be nice to have that as an option.

@hadley
Copy link
Member

@hadley hadley commented Jun 1, 2018

I like your proposed interactive option

@jennybc jennybc added the feature label Jun 1, 2018
@jennybc jennybc added this to the v1.4.0 milestone Jun 1, 2018
jennybc added a commit that referenced this issue Jun 1, 2018
Fixes #378 Avoiding committing unwanted files with use_git()
jennybc added a commit that referenced this issue Jun 1, 2018
Fixes #378 Avoiding committing unwanted files with use_git()
@jennybc jennybc closed this in #381 Jun 1, 2018
jennybc added a commit that referenced this issue Jun 1, 2018
Fixes #378 Avoiding committing unwanted files with use_git()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.