How do I remove commits, waiting to be pushed to remote? My situation is, that those queued commits (changes) been already pushed (more bellow) and now the server refuses to accept those as they are behind the HEAD. I tried resetting to another commit, but when I go back to HEAD, pushes reappear again. SourceTree […]
I just cloned a project using git and opened a new branch. After changing just 1 file I tried to commit the changes but it shows me that I am commiting like 3000+ files. After clicking on any file to see the differences, the phpstorm says “no differences”. I heard that might be an error […]
If I fixed a bug in a file in branch branch_a, which should be applied to all branches. Is there a way to apply the change to all branches without having to checkout the branches individually. git commit -m ‘commit msg’ # on branch a git checkout branch_b git cherry-pick branch_a git checkout branch_c git […]
I know how to list the remote branches $ git branch -a And I know how to find the head commit hash of my current branch $ git rev-parse HEAD But I’m not sure how to list all the head commit hashes for all the remote branches. This is close to what I want but […]
I know that I can use git commit –amend –file=path-to-my-new-message but this will amend staged changes, too. Of course, I could stash and later apply&drop the stash, but is there a quicker solution to change the HEAD commit message without committing the staged changes (and user interaction)?
I ‘renamed’ a file manually by deleting the old one and adding another with the new name. How do I undo this in the commit history and use git mv instead?I need to rebase my feature branch to the updated parent where the old file name is still being used. I don’t want to lose […]
I’d like a recipe for finding duplicated changes. patch-id is likely to be the same but the commit attributes may not be. This seems to be an intended use of patch-id: git patch-id –help IOW, you can use this thing to look for likely duplicate commits. I imagine that stringing together “git log”, “git patch-id” […]
I’m trying to add two directories to a git repo. I can add them OK, but when trying to “commit“, I get “nothing to commit”. I’m following the add->commit->push sequence, but in this case it doesn’t seem to be working. I have already pulled everything from the repo. Any hints? thanks!
Git push is getting rejected with the following error message: expected committer email ” but found ‘email@example.com’ I have already tried: setting use properties in .gitconfig file. trying git push making different clones of same repository. setting up whole system all together after formatting it. But none has worked. What else can I do to […]
I need a way to quickly move to the previous and next commit in a git branch. For the previous I found that I can do: git reset –hard HEAD~1 And probably alias that in a git prev or something, but I can’t find out how to move “up” to the next commit. And ideal […]