I want to add all the files in the current directory to git:
git add . error: open(".mysql_history"): Permission denied fatal: unable to index file .mysql_history
That's fine. That file happens to be in this directory and owned by root. I want to add all other files. Is there a way to do that without having to manually add each file by hand?
I know that I could add the file to exclude or .gitignore, but I'd like to have it just ignore things based on permissions (there's a good chance other files like this will end up in the directory, and adding them to .gitignore all the time is a pain).
The folder which is giving you fatal: adding files failed message on git add command is actually implying that there is another . git folder inside the folder. If you navigate to the particular folder address, you can remove the file and put git add. It should work.
Open Security for a repository You set Git repository permissions from Project Settings>Repositories. Open the web portal and choose the project where you want to add users or groups. To choose another project, see Switch project, repository, team. Open Project settings>Repositories.
The easiest way to add all files to your Git repository is to use the “git add” command followed by the “-A” option for “all”. In this case, the new (or untracked), deleted and modified files will be added to your Git staging area. We also say that they will be staged.
Use git add --ignore-errors .
This will still give an error for the unreadable file(s), but not a fatal one. The other files will be added.
Closing your IDE or whatever that uses the relative files you want to upload solved my problem
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With