| Post Reply | RetroFed Forums Forum Index » Git |
| Author | Message | ||
|---|---|---|---|
|
ZILtoid1991 lemmy.world ZILtoid1991@lemmy.world Joined: 2024-03-16 |
I'm thinking on writing some tutorial on de-sloppifying some open-source projects, with I'm likely ending up at least starting some of them. |
||
| 6 Original | |||
|
bignose programming.dev bignose@programming.dev Joined: 2025-03-03 |
It may depend where the project is and what you want to bring with you. If you're asking solely about the Git repository: you need to find exactly which commit is the latest one you want to bring, and specify that commit identifier (the hash of that commit) as the “starting point” when you create a new branch.
https://git-scm.com/docs/git-branch So, clone the repository locally however you need to do that. Then, in your local repository, modify what the branches point to: e.g. If you determined the latest commit you want to bring, has commit identifier “deadbeefbad1dea”, you can create the branch named “before-the-slop”:
Now the new branch “before-the-slop” has all the commits up to that, and no further. That's what you'll base your fork on.
Then rename the old “main” or whatever branch, to something like “sloppified-project-main” that gets it out of the way; rename your “before-the-slop” branch to “main”; and set “main” as the default branch in your repository.
Some time later, when you've confirmed your repository is how you like it, delete the “sloppified-project-main” branch:
and breathe easy. |
||
| 6 | |||
|
zener_diode feddit.org zener_diode@feddit.org Joined: 2025-04-06 |
You should be able to just fork it normally, then reset (or is it revert?) to the commit you want. |
||
| 6 | |||
|
0xDEADBEEFCAFE programming.dev 0xDEADBEEFCAFE@programming.dev Joined: 2023-08-27 |
A shorter example:
Note that instead of |
||
| 7 | |||
|
stembolts programming.dev stembolts@programming.dev Joined: 2023-07-11 |
[deleted]
|
||
| 0 | |||
|
FizzyOrange programming.dev FizzyOrange@programming.dev Joined: 2023-09-24 |
You know you can just ask AI trivial questions like this? This is well within its capabilities. |
||
| -3 | |||
|
ZILtoid1991 lemmy.world ZILtoid1991@lemmy.world Joined: 2024-03-16 |
You know you can just ask AI trivial questions like this? This is well within its capabilities.
One up your trolling! |
||
| 3 | |||
|
expr programming.dev expr@programming.dev Joined: 2023-07-03 |
[deleted]
There's no sense in deleting a project's history before the fork, which is what that would do. It's really quite simple:
|
||
| 5 | |||
|
stembolts programming.dev stembolts@programming.dev Joined: 2023-07-11 |
There's no sense in deleting a project's history before the fork, which is what that would do. It's really quite simple: git reset --hard <some-commit-hash>. This will set HEAD to that commit, along with the contents of the working directory. You are the free to push to whichever git forge you are hosting on.
[deleted]
|
||
| 1 | |||
|
FizzyOrange programming.dev FizzyOrange@programming.dev Joined: 2023-09-24 |
One up your trolling!
I mean... It legit can though. You may hate AI for coding but I don't see why you wouldn't use it for questions like this. Do you not think it could answer this question? |
||
| 0 | |||
|
expr programming.dev expr@programming.dev Joined: 2023-07-03 |
[deleted]
Sure that works too, though you would likely need to configure your git forge to treat that new branch as the master branch. A branch is ultimately just a pointer to a particular commit, though usually git forges treat one particular branch as "special" (it's the default branch used for clones, and typically disallows direct pushes). This is usually the master or main branch. So my |
||
| 2 | |||
|
HubertManne piefed.social HubertManne@piefed.social Joined: 2025-03-13 |
I mean... It legit can though. You may hate AI for coding but I don't see why you wouldn't use it for questions like this. Do you not think it could answer this question?
why ask ai for something like this. You know you could just ask a forum of people interested in the topic. I don't get why people who want to participate in a forum then feel people should not bring up things to discuss in a forum for the life of me. |
||
| 2 | |||
|
FizzyOrange programming.dev FizzyOrange@programming.dev Joined: 2023-09-24 |
why ask ai for something like this. You know you could just ask a forum of people interested in the topic. I don't get why people who want to participate in a forum then feel people should not bring up things to discuss in a forum for the life of me.
Because it will give you an answer instantly? There are plenty of other things you can bring to forums - news, projects, etc. |
||
| 1 | |||
|
HubertManne piefed.social HubertManne@piefed.social Joined: 2025-03-13 |
Because it will give you an answer instantly? There are plenty of other things you can bring to forums - news, projects, etc.
and you could try ai on all those other things and you can just talk in a forum for this. Some people don't really use ai. Heck I mostly just use it to sorta evaluate it. I have high hopes for future open source local uses that are more to my liking but what we have now is something I take with a grain of salt. |
||
| 2 | |||
|
FizzyOrange programming.dev FizzyOrange@programming.dev Joined: 2023-09-24 |
and you could try ai on all those other things and you can just talk in a forum for this. Some people don't really use ai. Heck I mostly just use it to sorta evaluate it. I have high hopes for future open source local uses that are more to my liking but what we have now is something I take with a grain of salt.
I'm not sure what you're trying to say. Why would you announce news to AI? |
||
| 1 | |||
|
HubertManne piefed.social HubertManne@piefed.social Joined: 2025-03-13 |
I'm not sure what you're trying to say. Why would you announce news to AI?
so like. im not here for news. im here for communication with humans. so it depends I guess on the reason you are here. |
||
| 1 | |||
| Post Reply |
Back to top |