The officially official Devuan Forum!

You are not logged in.

#1 2024-02-11 05:36:02

zapper
Member
Registered: 2017-05-29
Posts: 967  

[SOLVED] Want to compile something, but need to revert some stuff,

Does anyone know what commands would work using git in reversing all commits to a specific one?

Like say there are 100 after commit ab30493

what command(s) would I use to remove every changed commit after ab30493.

That's just an example,

Ie, so it would be like it was before the 100 commits.

Can anyone answer me?

Feel free, I will wait nearby hopefully.

Or tomorrow maybe, etc...


Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term  If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Peace Be With us All!

Offline

#2 2024-02-11 05:54:21

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,251  

Re: [SOLVED] Want to compile something, but need to revert some stuff,

git reset ab30493

That will reset the checked out tree to the files of that commit, and mark that as HEAD for this workspace. The future history of the project following that commit will remain.

Offline

#3 2024-02-11 17:00:07

boughtonp
Member
From: UK
Registered: 2023-01-19
Posts: 212  
Website

Re: [SOLVED] Want to compile something, but need to revert some stuff,

Running git reset revision will change where HEAD is pointed, and - depending on various factors - may or not result in losing history, and may affect the ability to interact with remotes.

Alternatively, git checkout -b branch revision will create a new local branch at that point, allowing one to make changes but not lose history, and retaining the ability to push/pull as normal.

There are a bunch of other potential options depending on precisely what the situation is and what the desired outcome is.


3.1415P265E589T932E846R64338

Offline

#4 2024-02-12 01:53:44

zapper
Member
Registered: 2017-05-29
Posts: 967  

Re: [SOLVED] Want to compile something, but need to revert some stuff,

I actually looked this up at one point, before I saw you replied here and the solution was git reset revision --hard

That seems to be what I wanted most of all.


Freedom is never more than one generation away from extinction. Feelings are not facts
If you wish to be humbled, try to exalt yourself long term  If you wish to be exalted, try to humble yourself long term
Favourite operating systems: Hyperbola Devuan OpenBSD
Peace Be With us All!

Offline

Board footer