You have my sympathy. Git is (was) designed by and for the developers of 
the Linux operating system, and operates with a quite different philosophy 
to old style 'version control' systems. This can lead to a lot of initial 
difficulty while you get your head around the new ideas.

The first part is that your Git stores your versioned files locally, and it 
stores them inside a sub-directory called `.git`. That `.git' file is 
created when you either do the `git init` command, or clone another 
repository. It looks like you already have a `.git` file higher up in the 
file system path than the current working directory of that bash process. 
Use the `pwd -W` command if on Windows to see where the bash thinks its is. 
It may not be where you thought (there is no 'root' directory on the 
Windows FS, just drives!).

Don't use `git add .` until you have got a feel for what is going on. the 
`.` means 'everything' in the current working directory and below - 
probably a lot more than you wanted! Don't worry too much as Git takes a 
'certified copy' of the files, rather than moving or changing them, and 
puts those copies in that .git repository (read on), usually compacted, so 
not wasting much space.

It is likely that you already have (because of who-knows-what) a .git repo 
at a higher level that you think you are at (see `pwd -W` above). Use the ` git 
rev-parse --show-toplevel` (as always read the docs ;-) to see where that 
repo is located. Once you know where that repo is located you can decide if 
that magic command you got from the internet is the one you want (probably 
not, as miss-typed).

Philip


On Sunday, October 25, 2020 at 1:05:18 PM UTC anca...@gmail.com wrote:

> Hi! I am a beginner to Git. I opened a folder located on my Desktop with 
> “Git Bash Here”. I run “git add.” without entering “git init” first. Now 
> almost all of my computer files (the ones on the Desktop) are in the 
> “Untracked files” folder.
>
> I already ran “git -r - -rm cached” but Git deleted what was in the index 
> folder. I can’t understand how a program that is supposed to just copy what 
> is already on my computer has the power to delete folders from it without 
> asking.
>
> I need a command to make Git let my Desktop files alone. I don’t want to 
> commit my whole computer in Git, I just want to get to “working tree clean” 
> without deleting all of my documents. The suggestions I found on the 
> internet require a risk of being left with nothing on my computer.
>
> Could you please help me?
>
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/675eff22-6f1f-49df-b61d-10a23a8f3945n%40googlegroups.com.

Reply via email to