If if git init on the nginx folder i get a permission denied cause the folder is own by root. Question: is there a way to initiate a git project to that folder without have to use sudo or without having to change the folder from being owned by root?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
You will have hard time with this, this is not so possible without sudo. Basically git init creates empty git structure in current folder. It is one folder called .git which have everything about it - commits info, branches info, etc.
If your user can’t create folder in nginx folder, you can’t use git init.
You have login as root, or use sudo git init, it should be working
Even if you do git init somewhere where you have write access (like home folder), you can’t move .git to nginx folder as you don’t have write permissions on it
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.