Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a git repo for wordpress: git add --all deletes all data

Shaklin Syed
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 2, 2018

Hi,

I have been trying to setup git for a WordPress server.

The issue is after running git add --all command - Mostly all the files in the directory get deleted. 

While I check the status after the add command I get two blocks of logs where one block list all files are created and other where it lists all files are deleted. 

Also while I add bitbucket remote to local repo. I get an error stating,

"There are too many unreachable loose objects; run 'git prune' to remove them."

This issue occurs only in one server, tried the same routine in another server, works fine. 

1 answer

0 votes
Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 6, 2018

Hi Shaklin!

Have you renamed or changed the location of the files? Git add --all adds, modifies, and removes index entries to match the working tree. My first recommendation would be to do a git status to see which files have changed.  

Also, it's important to note if the files are just been removed, or are being removed and re-added?

Regarding the error message, have you tried running the git prune in your server? Did something change?

Let us know!

Ana

Shaklin Syed
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 6, 2018

Hi Ana, 

"Have you renamed or changed the location of the files?"

No, I was setting up git in the www folder of active WordPress server. I tried the same with another server there was no issue. 

"My first recommendation would be to do a git status to see which files have changed. "

Yes, I ran git status before git add --all everything was fine, the server was running.

But when I tried git add --all that is when files started to disappear and the server stopped serving requests.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events