0

The following worked to update author/email, etc. However, it left a detached commit(the red in the image) that is the original initial commit. How can I get rid of it?

git filter-branch --commit-filter \
'\
export GIT_AUTHOR_NAME=userid;\
export GIT_AUTHOR_EMAIL=useremail;\
export GIT_COMMITTER_NAME=userid;\
export GIT_COMMITTER_EMAIL=useremail;\
git commit-tree "$@"'

enter image description here

caot
  • 2,274
  • 22
  • 30
  • If this is the latest commit that you have done than you can use **git reset HEAD** – Channaveer Hakari Dec 01 '17 at 16:24
  • @ChannaveerHakari No. It had a list of commits. After changing all of the author/email. The original initial commit became isolated. – caot Dec 01 '17 at 16:27
  • Is that awsering your question https://stackoverflow.com/questions/3765234/listing-and-deleting-git-commits-that-are-under-no-branch-dangling ? – Lavock Dec 01 '17 at 16:27
  • What do you mean, "get rid of"? As soon as it's unreachable, it'll be eligible for garbage collection. By having it checked out, you're *making* it reachable (since `HEAD` is a reference in and of itself), but check out something else (and maybe clear the reflog if you're in a hurry to be rid of it immediately) and that'll no longer be the case. – Charles Duffy Dec 01 '17 at 17:49

1 Answers1

0

Here is the way how to get what I expected. In SourceTree, go to Repository --> Repository Settings ... --> Remotes --> Remote repository paths --> removed all of entries under Remote repository paths. The bad thing is I have to add remote URL/Path once more.

caot
  • 2,274
  • 22
  • 30