deletes a folder locally but can’t save the change remotely on github "Everything up-to-date"

Asked

Viewed 62 times

0

inserir a descrição da imagem aqui

deletes the folder, I used git add and commit, it detected the changes in the commit but still when I push the master it says it’s "Everything up-to-date" what I’m doing wrong ?

  • 1

    Tried to push?

  • what’s the difference to this forced push ? it re-writes all folders ? has some way to just delete the folder I want you to delete ?

  • I used push origin --force <branch> and it worked. thanks

  • Yes, Repo will be recreated. No problem brother, but it’s not normal to need --force. And it looks like the commit says "0 deletions". If it happens again, we’ll investigate.

1 answer

0


Git does not versioning empty folders, so only deleting the contents of the folder will cause it to quit versioning.

I created a file with a file at the root and two files in a folder:

A imagem mostra o conteúdo do repositório

In Git it is not enough to delete the files directly on the file system or disk, it is necessary to do this by deleting command:

git rm .\files\*.txt

The above command deletes all txt extension aquifers from the files folder. Note that I have not deleted the folder, nor directly from the directory.

Then I committed this change. The image below shows the commit and file listing in the repository, showing that the folder no longer exists.

Comando de exclusão e commit da alteração

To upload changes to Github just use the command:

git push origin master

Assuming your remote is origin and the branch is the master.

It is not necessary to use the force, because if there is no inconsistency between remote repository and location, deletion of files or folders do not require special permissions.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.