In my README.md
I have a link to a GitHub issue:
Fix world
__ Fix: https://github.com/eth-brownie/brownie/issues/1174
I am continually rewriting (and then force pushing) a commit to GitHub. (message
contains the last commit's message which contains the GitHub issue link):
message=$(git log -1 --pretty=%B | awk 'NF{$1=$1};!NF||!seen[$0]++')
git commit --amend --quiet --no-verify -m "$message"
git push -f
After doing this operation many times, in the GitHub issue link I see the following:
Overall I observe that each commit into my last commit had a footprint into the GitHub issue URL. Would it be possible to prevent this?
Basically after doing adding more changes to the last commit, I want to clean its previous linked footprints on GitHub issues, and only keep a single reference related to my latest commit.
What's the reason to rewrite a commit so many times?
I doing my work in a development
branch.
By habbit I keep doing this operation when I make a single change on the branch I am working on. When I switched into another node, I do git pull --rebase
(this triggers itself automatically on the background) and I continue on working on the branch and if I make change I do the commit again into the latest commit.
I just wanted to keep my git history clean for other nodes.
you have pushed all of those commits with messages referencing the issue
Yes sir, commit message remains unchange which contains the URL to the issue. I was keep pushing them into mydev
branch which will be pull from other nodes if there will be any change. I was assuming since I am overwriting into my latest commit I thought that there will be single commit that contains all the changes I made. I just wanted to keep my commit history clean , I am not sure this way is a proper way to do it.