0

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.

2
  • (1) 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-git as the git repo after modifications were completed, and then synchronized or copied to /your-RealWeb/ . Commented Sep 14, 2024 at 5:45
  • @life888888 thanks for your comment, the thing is that i need to actually execute git operations on my working directory because i use lazygit, a terminal based program that lets me interact with my git repos real fast and with little to no effort, i'm currently working exactly as you describe, working on another directory and then copying its content to be able to run it on my web server, but that is a suboptimal solution. suddenly today i just found out that i needed to manually and as sudo set my github username and email. After i did this and changing the ownership to my user is now workin Commented Sep 14, 2024 at 23:53

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.