C
C#14mo ago
Paulvv

Delete changes on Github

I try to remove 3 brenches and keep the "master" brench. But i dont know how to do that.
24 Replies
Florian Voß
Florian Voß14mo ago
failed to delete the branch from the remote repository, see the output window for more details
what does the output window say? do you only wanna remove branches or merge them into master / main?
Paulvv
Paulvv14mo ago
Paulvv
Paulvv14mo ago
remove the 3 incoming ones i dont want to merge them i want to delete them if possible they where mistakes
ZacharyPatten
ZacharyPatten14mo ago
is the repo public? if yes please link
Paulvv
Paulvv14mo ago
GitHub
GitHub - TheBaldCoder/TheBaldCoderBlog: My own blog website.
My own blog website. Contribute to TheBaldCoder/TheBaldCoderBlog development by creating an account on GitHub.
ZacharyPatten
ZacharyPatten14mo ago
there are multiple ways to do what you want though. one of the easier options in my opinion is to make a branch off of the commit you want to revert to
Florian Voß
Florian Voß14mo ago
there is only a master branch in this repo 🤔
ZacharyPatten
ZacharyPatten14mo ago
and then force push that to your main branch
Florian Voß
Florian Voß14mo ago
ohhhh he wants to revert commits
Paulvv
Paulvv14mo ago
I'm so sorry its commits i'm so dumb
Florian Voß
Florian Voß14mo ago
nah all good it was just a little missleading for me
ZacharyPatten
ZacharyPatten14mo ago
you can use "git reset"
git reset --hard HEAD~3

git push --force origin master
git reset --hard HEAD~3

git push --force origin master
or you can make a branch off on the commit you want and then force push the branch to the master branch either of those options will work for you just be careful doing what you are doing in general you don't want to delete commits you just push a new commit to fix it
ZacharyPatten
ZacharyPatten14mo ago
if you want to try the branch approach I mentioned:
Paulvv
Paulvv14mo ago
but if i push a new one the changes "3 incoming" will be merged with it
ZacharyPatten
ZacharyPatten14mo ago
yes what is your issue with that?
Paulvv
Paulvv14mo ago
sorry i mean if i make a new commit. The other 3 incoming changes will merge with the changes i made. But i want to delete those 3 commits
ZacharyPatten
ZacharyPatten14mo ago
yes I understand, and I gave you two options to remove the commits if you want to do that I'm just saying that in general you want to avoid deleting commits. it is generally better just to fix whatever the issue is with new commits commits are historical they help you find who changed what at a given point in time
Paulvv
Paulvv14mo ago
Oh i thought it was for project control. If your project gets corrupted or something then you could go back to the previous version like a unity game that keeps crashing and you want to restore the changes you made
ZacharyPatten
ZacharyPatten14mo ago
well returning to a previous version is definitely a use case for commits but also for history and finding out who made a change
Paulvv
Paulvv14mo ago
but what is the proper way to do this? The 2 options you gave me?
ZacharyPatten
ZacharyPatten14mo ago
I can't really answer that because "proper" is subjective are you still wanting to remove the comits? if yes, then either option I mentioend with give you the exact same outcome so either is fine
Paulvv
Paulvv14mo ago
Thanks for the help. I'm making a different brench
ZacharyPatten
ZacharyPatten14mo ago
yep, just make the branch on the commit you want to roll back to and then force push that branch into your master branch then you can delete the extra branch you made when you are done
Paulvv
Paulvv14mo ago
i will thanks
Want results from more Discord servers?
Add your server
More Posts
❔ Why "Chart" is not available ?Hi, as you can see on my screens, the "Chart" are not available, i can't drag them directly on my Fo❔ Looking for C#/Unity devs for short interviewsHey! Do you want to help me design a game? 🎮 For my Bachelor thesis I am developing a game to visua❔ Gleaning process launch information from Process reference attained via GetProcessById?Given a process ID I would like to determine all parameters necessary to relaunch that process (same❔ Binding question for winforms DataGridViewAll the examples I can find show how to bind to a row object that has fixed properties such as: row❔ Meta Marketing API unnecessary Stephttps://developers.facebook.com/community/threads/602165615210717/?post_id=602165618544050 I define❔ Random Empty Column is shown in the DataGridHi I have a datagrid in WPF and for some reason I always have this empty column. Is there a way of d❔ api doesn't return anything.https://github.com/emt2dev/MandalorianAPI .net 6 ```cs using MandalorianAPI.Models; using Mandaloria✅ How To Return 2 numbers inside of an If/Else statement```cs using System; using System.Threading; namespace MeksMathGame { class Program { ❔ Question regarding custom validation in Identity.Do you have any idea how to fix this?. When the custom validation in identity triggers all of sele❔ Removing a certain block that pops up when minimizing a borderless formHello. I need a little help about a program I made. So, whenever a fullscreen form minimizes, an blo