Answer the question
In order to leave comments, you need to log in
Git how to delete file directly in remote repository?
the task is this: to delete a file in a remote repository
, two ideas immediately came to mind
1) you need to work with https://bitbucket.org, which has a file deletion function. The teacher said to do it through git!
2) delete the file in the local repository, commit and push, actually deleted (only left in the history, but okay). The teacher said to do everything directly,
as I understand it, I need to go to the remote repository as one of the folders on my computer, and delete the file (THE EVERYTHING IS DONE DIRECTLY) The
question is how to do this ??? Work is done from https://bitbucket.org
Answer the question
In order to leave comments, you need to log in
Git can't go ahead and remove a file from a repository without creating a commit (or breaking the history). Your option #1 does just that. Bitbucket creates a commit in which it deletes the file. So, your option #2 is the correct solution.
Of course, you can delete the file from the history, but you have to overwrite the history again, but it's still done locally, and then git push --force
PS It's very interesting what your teacher wants. Tell us then "the right decision"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question