How to make changes to a file in all of my previous commits?




I have a private repository. I was using MIT license. But now I want to change it to GPL3 before making it public. The problem is that if I change the license in a commit and push it, technically, you are allowed to use a previous commit according to MIT license (which I don't want).


Is there a way to change the license in all of the previous commits? I heard about doing it individually for each commit in git rebase but there needs to be a better way!
If all you want to change is a single file, do that and commit it.


Then you can use `git rebase -i` to rearrange commits. In particular, you can move the change to the license file to the beginning of history, as if it had always been there.
This depends a lot on what you mean by "revert".


Temporarily switch to a different commit



If you want to temporarily go back to it, fool around, then come back to where you are, all you have to do is check out the desired commit:



```
# This will detach your HEAD, that is, leave you with no branch checked out:
git checkout 0d1d7fc32

```

Or if you want to make commits while you're there, go ahead and make a new branch while you're at it:



```
git checkout -b old-state 0d1d7fc32

```

To go back to where you were, just check out the branch you were on again. (If you've made changes, as always when switching branches, you'll have to deal with them as appropriate. You could reset to throw them away; you could stash, checkout, stash pop to take them with you; you could commit them to a branch there if you want a branch there.)


Hard delete unpublished commits



If, on the other hand, you want to really get rid of everything you've done since then, there are two possibilities. One, if you haven't published any of these commits, simply reset:



```
# This will destroy any local modifications.
# Don't do it if you have uncommitted work you want to keep.
git reset --hard 0d1d7fc32

# Alternatively, if there's work to keep:
git stash
git reset --hard 0d1d7fc32
git stash pop
# This saves the modifications, then reapplies that patch after resetting.
# You could get merge conflicts, if you've modified things which were
# changed since the commit you reset to.

```

If you mess up, you've already thrown away your local changes, but you can at least get back to where you were before by resetting again.


Undo published commits with new commits



On the other hand, if you've published the work, you probably don't want to reset the branch, since that's effectively rewriting history. In that case, you could indeed revert the commits. With Git, revert has a very specific meaning: create a commit with the reverse patch to cancel it out. This way you don't rewrite any history.



```
# This will create three separate revert commits:
git revert a867b4af 25eee4ca 0766c053

# It also takes ranges. This will revert the last two commits:
git revert HEAD~2..HEAD

#Similarly, you can revert a range of commits using commit hashes (non inclusive of first hash):
git revert 0d1d7fc..a867b4a

# Reverting a merge commit
git revert -m 1 <merge_commit_sha>

# To get just one, you could use `rebase -i` to squash them afterwards
# Or, you could do it manually (be sure to do this at top level of the repo)
# get your index and work tree into the desired state, without changing HEAD:
git checkout 0d1d7fc32 .

# Then commit. Be sure and write a good message describing what you just did
git commit

```

The [`git-revert` manpage](https://schacon.github.com/git/git-revert.html) actually covers a lot of this in its description. Another useful link is [this git-scm.com section discussing git-revert](https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_undoing_merges).


If you decide you didn't want to revert after all, you can revert the revert (as described here) or reset back to before the revert (see the previous section).


You may also find this answer helpful in this case:  

[How can I move HEAD back to a previous location? (Detached head) & Undo commits](https://ask4knowledgebase.com/questions/34519665/how-can-i-move-head-back-to-a-previous-locationdetached-headundo-commits) hey,

if you want restart the refer to this -

[image]

[how to do git reset?](https://forum.crio.do/t/how-to-do-git-reset/9567) [setup and git](/c/common-faqs/setup-and-git)

hi there,

looks like you are facing challenges and you want to reset your git repository.

great. let me help you here.

there are three scenarios where you would require to reset … [image] paulaniculaesei:

but if i make from vs code a new branch , why i can’t open a pull request?

because you need to push the branch to somewhere public first. you can’t push your branch to someone else’s repository, so you need your own (a fork in github terms). This is indeed something of a problem. It is always difficult to jump into a new and large code-base. You should concentrate on any available overview documentation (e.g., explaining how it works or is structured), tutorials (e.g., showing how to make mods), and reference documentation (e.g., class references).


If you need to really dig into the source code of the library / application, then you need to find a relevant starting point. This could be something that is similar to what you want to do or modify. When you find a decent starting point, just look it up and try to understand what it does and how it works, and work your way out from there, by looking up related code (e.g., that is called within that code you are looking at, etc.). The "find in files" is definitely a central tool when exploring a code-base because it gives you an instant snapshot of where certain things are used and declared. For example, if you want to modify the behavior of class A, then there is a good chance that you will want to look at all the places where class A is used so that you can assess if your modified version will work or if you need to modify other things.


There is no doubt that doing this is hard and takes a lot of patience. I've done this several times with different code bases (some small ( < 50,000 LOCs ), some big ( > 1,000,000 LOCs )), and it's always a tedious process, especially if documentation is lacking (which it very often is). For editing with IBE you won`t need a CC subscription.If you upload once with filezilla or similar you won´t be able to edit within IBE ever.So if you want to keep asup to date as possible, make some changes in layout or content you should stick with CC.You can hardly add some content, which you did not set up enough space with IBE, for this you will need muse and so CC.BTW, basically you can purchase Muse as a single app – if this is available till the EOL announcement I do not know for sure.Be... impact : changing c# methods from private to public what to do::

docker exec -it gitlab /bin/bash

then

apt install update-manager-core

then

do-release-upgrade all shared projects do is inject the shared files into the projects that use them — essentially as if you just added the same file to both projects manually and had two icons show up in the tree for it. given how swift does name spacing, for each project the file will compile so that its types go in… your license should match the number of users on your system, so you may need to request a new license.

this command can be used to reset a password: <https://docs.mattermost.com/administration/command-line-tools.html#mattermost-user-password>. hi mike, thanks for bringing this to our attention, i can confirm that i’m aware of this issue and a fix is in progress. i expect the latest version to be available the debian/rpm repositories in the coming days.

one short term work around would be to download the .deb or .rpm file directly from th…