529 questions
Score of 0
1 answer
104 views
Why do I still show local files from a branch after a git revert of the merge?
I am a newcomer to Git and am probably missing something basic.
My desired practice is to create a branch from main, work on a given release in that branch, and merge to main when release code is ...
Score of 1
1 answer
121 views
How do I get "git reset" to also automatically reset submodules?
I'm working on some projects with a number of submodules, so it's nice to be able to reset the submodules when working on the main project. One way to solve this is by adding a flag to the reset to ...
Score of 0
3 answers
333 views
Git says my branch is ahead of origin - even after revert/reset
On a recently cloned project, I just now made an unintentional change/commit to my local main branch. (I had intended to create and check out a new feature branch for the change, but I wasn't ...
Score of 2
3 answers
138 views
How to delete a merge commit from git history?
My git history looks like this:
A---B--------D---F
\ / /
\____C/__E/
Where head is now at F, and D and F are merge commits. I forget a rebase at E from D, but only realized after ...
Score of -2
1 answer
68 views
Does "git reset --hard HEAD~1" on main branch remove this commit from another branch's history (when that branch is based off main)?
Let's say I have a, b, c, d commits on main. I use "git checkout -b new-branch" while on d. On new-branch I make commits e, f.
I want to remove d from main, but keep it in new-branch. If i ...
Score of 0
0 answers
49 views
Reset all uncommited changes when working in a local Git repository
I need to reset all uncommitted Git changes while working in a local Git repository. I'm using this answer to the 12 year old Unstaged changes left after git reset --hard question in a Python script
...
Score of 0
2 answers
67 views
Regarding the repercussions of git hard reset on remote
Resetting remote to a certain commit
We would like to reset the remote to a certain commit on a specific branch (say branch A) in our project. However there are the following concerns:
We recently ...
Score of -1
1 answer
130 views
Is there a way to reset or remove all my commits into the dev branch?
I have been working on different branches and anytime task is ready I commit and create a pull request into the dev branch. Till now everything is okej, but is there a way to reverse or remove all ...
Score of -1
2 answers
80 views
how to push an old reseted or reverted heads
I can go back and forward in my history using git checkout heads git revert heads git reset heads
And when I do git push origin main I get Everything up-to-date and no change on remote server.
how to ...
Score of 2
1 answer
300 views
How to reset committed file permission changes (mode change)?
I changed the permissions of all my files and directories of my git repository and committed it to my main branch, eg.
mode change 100755 => 100644 path/to/file.sh
I wanted to reset now these ...
Score of 0
3 answers
196 views
Need to recover from multiple errant `git reset` commands
I know that undoing a single git reset or git reset --hard command has been asked and answered, but I have really messed things up and am not sure how to proceed because I need to undo several ...
Score of -1
3 answers
74 views
How to remove a feature from master-dev after has been intermingled with other feature commits?
Let's say we have a git repo with a master-dev branch. When developers complete their features, each feature branch in merged into the master-dev. One day, A large feature is merged into master-dev ...
Score of -2
1 answer
132 views
Reset all files affected by past commit to the state before that commit
How do I reset all (and only) files affected by a given commit to the state before that commit?
I only need to reset the files in the commit, not the entire repository or single file/directory, and I ...
Score of -1
1 answer
131 views
I want to bring back COMMITED but then deleted files on my local repository after doing git reset hard
I have staged and commited a very large folder (created and only present on my local repository) but then I did git reset hard to revert my big commit which was a mistake. However, luckily, I commited ...
Score of 0
0 answers
72 views
How do I cancel a merge commit (non-squash)?
In this case, if you output git log --online, you should see something like this
c6 merge iss53 to master
c5
c3
c4
c2
c1
...
As you can see, c4,c6 are commits from the master branch, and
c5,c3 are ...