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.

Required fields*

4
  • 30
    The initial queston contains "just one file". Commented Jul 11, 2017 at 17:40
  • 2
    this replaces existing files rather than merging Commented Sep 12, 2018 at 23:44
  • 4
    This . makes a huge difference: instead of moving to another branch it copies all files from there while still leaving you on the current one. You get contents from other branch without going into it. Commented Sep 20, 2018 at 9:51
  • Why -1: first. this is an answer, but not to the question asked. Second, this overwriting all files in the current directory and all subdirectories unconditionally. Perhaps you shouldn't assume that the OP is a Git pro. Many people, in my experience, treat Git command like magic spells, and this form of the command is really dangerous. IMO, if you also allow me an advice not asked for, you'll make the community a better service by removing your answer. Commented Feb 26, 2021 at 11:35