android - How to ignore mistakenly committed files -
i have android project, , mistakenly added bin folder stage , committed it. how can ignore bin folder , ignore ever? added bin/ .gitignore file, nothing changes , see files in folder in working copy in sourcetree.
i using sourcetree git client.
along ignoring folder, need git rm
it. git ignores files aren't under control.
be aware, though: doing cause git remove folder else pulls changes. you'd better sure folder output building, or can otherwise reconstructed.
if haven't published changes yet (that is, if you've never pushed them anywhere , no one's pulled them you), have option of rewriting history. can git reset --soft the_commit_before_you_added_bin
(of course, you'll need actual commit id, or name it, head~3
etc) "uncommit" right before added it. working copy still have latest versions of files, git forget committed them. (this means lose intermediate changes.) can redo commit(s), being careful avoid bin
time.
git has filter-branch
command can allegedly automating that, , can preserve intermediate changes. i've never used it, though, , couldn't tell how use it.
obligatory big bold warning:
don't rewrite history has been published.
only undo/rewrite commits have never been pushed or pulled. otherwise, wackiness ensues.
Comments
Post a Comment