I am not sure what is the exact term for this problem. Basically, I need to remove some files & directory on my remote repository
I have a local git repo & remote repo in github
This is how my local repository looks like at the moment:
* 7e143b1 (HEAD)
|\
| * 18cea0f (origin/master, origin/HEAD, master)
| |\
| | * fc19ccf
* | | 6f3c58a
|/ /
* | 8d82486
|/
| * d3ce65f (pre-install-activeadmin)
|/
* 7d0566c
* d1c77ab
* 75ba704
* 30dc67c (heroku/master)
* f89b1f6
* ea5e2db
* 08931d6
* 9773a6f
* b636aba
* cb6f8d4
I can change my local repo to 7d0566c
. I am not sure where the head on my remote repo is pointing to.
How do I remove those files that are on remote repo but are not on my local repo?
Obviously, I do not see any of his files in my local repo because I did a reset of my HEAD to a previous commit. However, the remote repo still shows his files. When I commit, it commits just fine.
Is my workflow wrong? I should have just tested the patch at the first place. Any suggestion? I am new to version control. Thank you
Browse to the directory in your repository that you want to delete. In the top-right corner, click , then click Delete directory. Review the files you will delete. At the bottom of the page, type a short, meaningful commit message that describes the change you made to the file.
Execute the following command: git rm --cached path/to/file . Git will list the files it has deleted. The --cached flag should be used if you want to keep the local copy but remove it from the repository.
Pull the changes from the server, then do a git rm
on your local repo, commit the changes, and push to the server. The files will be deleted.
I'm assuming 18cea0f
is where your pull request merge happened. In order to revert that merge, you can do:
git revert -m 1 18cea0f
You can read more here: http://progit.org/2010/03/02/undoing-merges.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With