SJW <shannon.whi...@gmail.com> writes:

On Thursday, 31 August 2023 at 18:49:35 UTC+10 mag...@therning.org wrote:

What you are trying to do is to rewrite history on the central git repo. While git allows doing that, it does require you to signal that you are completely sure you know what you are doing. Look at '--force' and related flags in 'git push --help'. If you are working on this repo by yourself you can pretty much do whatever you want, but if you work with others and they have based any of their work on the 'staging' branch after you merged in your 'feature-branch', then you should look at 'git revert --help' instead.

Ok. This makes sense - I am working alone so I can force - if I was in a team, this would cause problems. So effectively, git has no easy "undo" option and requires manual removal of code

It depends on what you consider to be an "easy undo option". Many other version control systems won't allow you to rewrite history at all, leaving you with reverting as your only option (i.e. similar to 'git revert').

There are at least a coupld of things you can do - invest in ways to test locally, then you don't have to push at all. - invest in ways to test on your 'feature-branch', then you don't have to merge into 'staging' (and push the merge)

Testing changes has zero affect on business decisions deciding that changes previously requested are no longer viable. It is impossible to test a code base against the management teams inner thoughts and market forces!

Well, it depends on the situation and what led to the change in requirements. You haven't really given enough context to do anything but guess. Now, _if_ the decision was taken after testing your changes and seeing that the idea didn't pan out, _then_ testing without a merge would have prevented you from undoing merged changes ¯\_(ツ)_/¯

/M

--
Magnus Therning                   OpenPGP: 0x927912051716CE39
email: mag...@therning.org
@magthe@mastodon.technology       http://magnus.therning.org/

`This must be Thursday,' said Arthur to himself, sinking low over his
beer, I never could get the hang of Thursdays.'

— Arthur, on what was to be his last Thursday on Earth.

--
You received this message because you are subscribed to the Google Groups "Git for 
human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87o7im44ho.fsf%40therning.org.

Reply via email to