Skip to content

Trouble with adding files after installing Git #23838

Answered by TabW
TabW asked this question in New to GitHub
Trouble with adding files after installing Git #23838
Oct 4, 2021 · 2 answers

After successfully installing Git to my computer, I opened the Git Bash and typed in some test command lines to see if everything is working. The command line I typed was “git add .” and, I was given an output of errors.

This is the error I get:

I tried 5 times to uninstall and reinstall Git and, I also tried changing the install path. In addition, I tried looking up my issue on Google and, I found a post on the Github community with my similar issue, however the issue was not resolved.

If you need more information, please let me know.

Thanks in advanced.

I believe the issue is fixed. I used the command line to change the directory of the repository and, placed it in its own folder. Now, I am able to add files.

I am new to Git so I appreciate your help.

Replies

2 suggested answers

That looks like you previously ran git init in your home directory and turned the whole thing into a Git repository. Otherwise git add would complain about being called outside a repository. That’s (almost) certainly not what you want, though: In general you want one repository per piece of software or project.

Before you do the following, make sure you have the right one. There’s no going back (except with backups). ⚠️ To get rid of the accidental repository, delete its .git/ directory. Double check it’s the right one, and not a repository you actually want to keep.

0 replies

I believe the issue is fixed. I used the command line to change the directory of the repository and, placed it in its own folder. Now, I am able to add files.

I am new to Git so I appreciate your help.

0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants