Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • 16
    if you are the only person using the repo, it probably doesn't matter how you do it Commented Jan 3, 2024 at 18:50
  • 2
    This is what "git stash" is for. Commented Jan 4, 2024 at 9:30
  • 57
    Learn to use branches Commented Jan 4, 2024 at 12:53
  • 17
    @pjc50 "git stash" alone will just store things away locally. It won't get added to the repo, much less pushed upstream. It's appropriate for very short-term storage of unwanted changes, but if OP may "need them later", then this is probably not the right option. Commented Jan 4, 2024 at 15:24
  • 3
    “I suspect that what I am supposed to do is to create a separate branch, commit there and not merge into main. However, I have never used branches before, so I am reluctant to start if there is a simpler option.” Branches are the simplest option that does exactly what you describe. Commented Jan 5, 2024 at 21:04