Tag: commit

SourceTree – remove waiting pushes

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 […]

Project commits too many files

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 […]

git commit to all branches

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 […]

Head commit for all remote branches using 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 […]

Git: change HEAD commit's message without touching the index

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)?

Renaming with Git: Using git mv vs deleting a file and adding another

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 […]

git finding duplicate commits (by patch-id)

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” […]

git: I can add a directory, but at commit time I get “nothing to commit”

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 Error:- expected committer email '' but found 'karan@xyz.com'

Git push is getting rejected with the following error message: expected committer email ” but found ‘karan@xyz.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 […]

Git: Move to previous and next commit

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 […]

Git Baby is a git and github fan, let's start git clone.