Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does git log --branch have a different behaviour on normal and bare repositories?

I'd like to use the git log command to extract the list of changes from a repository since a given date on a specified branch.

For the purpose I found the following syntax which seems to work fine:

git log --since=2011-10-01 --branches=mybranch

The above command works fine on a cloned repository in my workstation (Ubuntu 10.04, GIT 1.7.7.2) but outputs a wrong log on the main repository from which the clone has been created. The main repository is a bare GIT repository hosted on Centos 5.5, GIT 1.7.3.4. Basically, the main repository does not show a number of the most recent commits.

I don't understand if this is the expected behavior and the difference is due to the fact that the main repo is bare, or if this is a different behavior due to the fact that the GIT version is not the same.

like image 714
GianMaria Romanato Avatar asked Nov 18 '11 12:11

GianMaria Romanato


1 Answers

Following the suggestion of "Does git log --branches work?", I have suggested in the comments:

git log --since=2011-10-01 mybranch

I.e:

  • using the name of the branch directly
  • not using the --branches option when accessing the logs of a given branch.

The OP giamma reports it works.

like image 111
VonC Avatar answered Sep 23 '22 14:09

VonC