Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tracking history of a branch

Tags:

git

How can I see the history of a particular branch?

I have been creating and merging branches. However, on one particular branch say for example new_feature. I want to know the history of what has been merged into this branch, and what branch this was created from?

The reason is I have this new_feature branch, and I want to know what other branches was merged into it, and what branch the new_feature was made from?

I an not really interested in using any GUI tools, maybe some on the command line. I'm using Git version 1.7.5.4 and Ubuntu 11.10.

like image 201
ant2009 Avatar asked Sep 28 '11 04:09

ant2009


People also ask

How do I see the commit history of a branch?

On GitHub.com, you can access your project history by selecting the commit button from the code tab on your project. Locally, you can use git log . The git log command enables you to display a list of all of the commits on your current branch. By default, the git log command presents a lot of information all at once.

What is commit history?

Commit history in Abstract is a log of commits that allows you to view the changes that have happened on every commit that has ever been made in a given branch, including the main branch.

How do I get to git history?

Git file History provides information about the commit history associated with a file. To use it: Go to your project's Repository > Files. In the upper right corner, select History.


1 Answers

git log --oneline --graph --all may give you what you want, without the need for third-party tools.

  • --oneline makes the commits display on one line only, instead of the longer default format.
  • --graph shows branch/merge history with ASCII characters.
  • --all shows all branches in the history, not just the current one.
like image 56
Andrew Marshall Avatar answered Sep 19 '22 11:09

Andrew Marshall