S
S
s_a_iii_a2019-09-04 15:42:36
git
s_a_iii_a, 2019-09-04 15:42:36

How to make changes to the very first commit?

And it's not about the name of the commit, but about specific lines of code.
In more detail, I need to remove the mention of some words in the project that I wrote using git. And the words are mentioned from the very first commit. The option with a new commit in which I removed these words will not work for me, since any user can roll back the project to those commits where these words are.
What are the solutions? In general, such problems can be solved with the help of the git? Can I somehow create a new branch? Or can you do without it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DevMan, 2019-09-04
@s_a_iii_a

https://help.github.com/en/articles/removing-sensi...

U
Unixspv, 2019-09-05
@Unixspv

You can do an interactive rebase: "git rebase -i". In the editing window that opens, set the "edit" mode for the first commit - this will allow you to edit both the content and the title of it ("git commit --amend"). After finishing with the commit: "git rebase --continue".
Further, if the branch has already been uploaded to the remote repository, then you will have to do "git push --force origin" (if the repository settings allow), and for other participants working with this branch, the changes will become a problem, because a simple "git pull" won't work anymore.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question