3

I'm new to using git and I'm getting a bit confused. What I'm trying to do is set up a new repository for a particular project folder. My first question is where exactly do I need to be filewise in the terminal, Desktop or the Folder itself to initialize the files. I tried navigating to the actual folder and typed in git status which listed the files as untracked so I typed git add to stage for commit which came up with "Nothing specified, nothing added. Maybe you wanted to say 'git add"

Not sure where I have gone wrong.

Lee Border
  • 31
  • 1
  • 2

2 Answers2

8

Please use git add . instead of git add

Jitendra Suthar
  • 2,111
  • 2
  • 16
  • 22
0

You can use "git add ." or "git add -A" instead of git add.

"git add" moves the changed file from the working directory to the staging area (git add file name with extension), while "git add -A" moves all the changes to the staging area. It does the same thing as "git add -all" or "git add. , git add -u" put together.

  • "git add" keeps track of new files and changes without deleting anything (on the current directory and its subdirectories).
  • "git add -u" puts changes and deletions in order without creating new files.

So, "git add -A" is a valuable way to do both things quickly.

Harsh
  • 812
  • 1
  • 10
  • 23