I've been trying to work with git on my php web project that i already had, just changed the file type to php to connect it to a database, and since is no longer html i needed a web server so i use xampp. The thing is that from the very beggining it doesn't let me clone the repo unless i do it as sudo, and when i do clone it with
sudo git clone https:github/myprofile/repo.git
it doesn't let me do things such as pulls, commits or pushes.
Any idea on how to solve this or another way to execute my project on a local web server while being able to use git would be really apreciated. If it helps i'm on arch linux(i use arch btw) and the latest version available of xampp.
Already tried changing the project's directory owner with
sudo chown myuser project/*
and then doing
sudo chown myuser .git/*
expecting this would be enough but still gives me errors regarding permissions.
mkdir ~/your-web-git/, this your git repo (2)cd ~/your-web-git/,git init(3)sudo cp -R /your-RealWeb/* ~/your-web-git/*(4)sudo chown myuser -R ~/your-web-git/(5) modify php, html in~/your-web-git/(6) run some git operation in~/your-web-git/(7) use sync or copy command~/your-web-git/to/your-RealWeb/. (8) I did not directly perform git operations on/your-RealWeb/, but used~/your-web-gitas the git repo after modifications were completed, and then synchronized or copied to/your-RealWeb/.