'How to git add some file to repository?

I want to add some files that menu.blade.php, index.blade.php, proses.blade.php and show.blade.php

I try like this :

https://postimg.org/image/g0t9ulmnl/

It's exist error like this : fatal: pathspec ... did not match any file

Is there any solution to solve my problem?

git


Solution 1:[1]

When you git add x, git will use x as a startingpoint for finding your file. Imagine it as a regex. It therefore takes wildcards such as * in order to e.g. add an entire subdirectory at once. (git add directory/*)

Your error is pretty clear though. menu.php is simply not found. But your git status clearly tells you which path you'll have to specify.

Solution 2:[2]

Here is how I stage files for a commit to avoid typing errors! It also speeds things up quite a bit.

  1. Type git status to pull up a list of modified files that you would like to add in the bash window.
  2. Type git add press space bar then double click or click and drag on the file that you would like to add so it is highlighted.
  3. Next, press ctrl + insert this will copy your selection to the clip board.
  4. Next, press shift + insert this will paste your selection from the clip board to the bash command line.
  5. Lastly, Press Enter this will now add the file to be staged if everything was typed correctly.


Best Regards!

Solution 3:[3]

Note that a simple git add . would add all your files.

If it adds too many (like the table.blade.php), you can reset it (un-stage it)

git reset resources/views/users

Solution 4:[4]

Best way to add all files in one go in git , you can use this command after

git init

then use git add --a

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 FMaz
Solution 2
Solution 3 VonC
Solution 4 Tanya sharma