2

I have created and pasted a .gitignore file to my master branch, and I want to move it to the hometask_1 branch with the windows 10 command line.

I have used the commands below:

git checkout master
git checkout hometask_1 -- .gitignore

After the above commands I am getting the following error:

error: pathspec '.gitignore' did not match any file(s) known to git

AbsoluteSpace
  • 710
  • 2
  • 11
  • 21
Edgar Shvedskiy
  • 135
  • 3
  • 18

1 Answers1

1

From this answer, you can move a file from one branch to another with: git checkout otherbranch myfile.txt from the branch where you want the file to end up.

In your case, from the hometask_1 branch, you can run: git checkout master .gitignore.

AbsoluteSpace
  • 710
  • 2
  • 11
  • 21