Tag: commit

How to write git commit messages for submodule updates?

I always struggle to write good git commit messages for commits which did nothing except update which commit a submodule is on. What I really want to write is “just read the freaking submodule commit messages!” Perhaps a slightly nicer solution is, does there exist something which goes to the submodule and concatenates all of […]

How does git handle commits in a merge?

I’m having trouble understanding how a git merge works in terms of the commits created by the merge process. I’ve read the relevant sections in pro git and the git community book, but am still confused. Consider this scenario: I have an “origin” git repo: master | a0–a1–a2–a3 \ -b0–b1 | branch2 I clone this […]

How can I change my git timezone offset?

I read that the –date argument when adding a commit can be used to specify the timestamp and the timezone offset. I’m curious if there’s a way to globally set just the timezone offset so it matches my timezone.. I’m in EST which is -0500 from UTC, and whenever I commit and push to Github […]

Find date for not dated commit?

I’m doing a git log to list all commits and then parse them. With this command: git log –encoding=UTF-8 –date=local –pretty=format:’%H,%P,%at,%ct,%an,%s’ In some weird repos i get commits without the date in both author and commit dates. I tried with the simple: git log and what i got was a 1970 date. A repo where […]

Git commit a commit message and nothing else?

When handling pull requests on GitHub, often I want to merge in commits from a branch with no changes. However, I would like to commit something just after the merge. I don’t want to git commit –amend because that would change the commit I’m bringing in, so tracking the change gets more complicated. Is there […]

Git: Unable to understand why branch (topic) commits/merges are happening on the master branch

Note: I am not sure whether this has been already asked, as I can’t find any question fitting to my context(or I am unable to understand the existing questions’ contexts’) I am loving Git these days. Especially, the topic branches. I am working on a small code sharing application. And I have got (local)branches like […]

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 Baby is a git and github fan, let's start git clone.