How do I figure out if a particular commit is in my current branch with EGit? - egit

I have a repository with many branches and I am tying to figure out if a particular commit (with a specific commit message) is in my current branch. I can find the "interesting" commit using the the find box at the bottom of the History view.
I tried following the vertical lines but there is so much line-crossing that I find it really hard to say if the commit is in or not.
Is there a way to see all commits that contributed to a particular branch as a single list?

When you select a commit in the history view, look at the detail area for this commit. After author and committer details, you can see which branches contain the commit (Branches: ...). In case this area is hidden, open the view menu (the triangle) and check Show > Revision Comment.
You can also open the commit in a new window using the context menu and selecting Open in Commit Viewer.

Related

How to view inline diff of multiple files at once in VS Code?

In VS Code, for a given commit I would like to see inline diffs from all files in one view or page, so that I would not have to click to see diffs for each file separately.
I can't find any extension that would do this.
Basically I'm looking for a feature like there is in Bitbucket when you click on a given commit, and you see all the differences in one page. Something like in the picture below.
in the SCM bar you have a COMMITS view
context click a commit and Select for Compare
context click another commit and Compare with Selected
Now in SEARCH & COMPARE view you can click a changed file and see a diff

eclipse--checked out previous commit to look around, now want to go back

I am using the latest Eclipse + eGit.
I needed to go back and look around at my previous commit so I went to the History tab and right clicked on the previous commit and selected "Checkout".
Now I'd like to go back to the commit I was on before I checked out the old one--but in the History view that commit isnt' there.
58504cb Added feature z
09a2df3 Added feature y, Checked out this commit
988c14b Added feature x
5a76bef Added feature w
When I checked out that commit, the history view looks like this now:
09a2df3 Added feature y
988c14b Added feature x
5a76bef Added feature w
The problem is I don't know the hash for the "Added feature z" commit. How can I get it back?
In the history view, there's a toolbar icon for "Show All Branches and Tags". In this screenshot it's the cyan one on the right-hand side with the arrow branching into two.
If you turn this on, your newest commit should reappear.

How to switch to other branch in Source Tree to commit the code?

Recently I have installed Source Tree in my windows machine. How can I use the source tree for commit, merge of code to central repository?? And also how can I switch the branches ?? Can any one kindly provide me the links on how to overcome this??
Hi I'm also relatively new but I can give you basic help.
To switch to another branch use "Checkout". Just click on your branch and then on the button "checkout" at the top.
UPDATE 12.01.2016:
The bold line is the current branch.
You can also just double click a branch to use checkout.
Your first answer I think depends on the repository you use (like github or bitbucket).
Maybe the "Show hosted repository"-Button can help you (Left panel, bottom, right button = database with cog)
And here some helpful links:
Easy Git Guide
Git-flow - Git branching model
Tips on branching with sourcetree
Go to the log view (to be able to go here go to View -> log view).
Double click on the line with the branch label stating that branch. Automatically, it will switch branch. (A prompt will dropdown and say switching branch.)
If you have two or more branches on the same line, it will ask you via prompt which branch you want to switch. Choose the specific branch from the dropdown and click ok.
To determine which branch you are now on, look at the side bar, under BRANCHES, you are in the branch that is in BOLD LETTERS.
Sometimes it is impossible to click on correct branch in history view. Find branch you want in left panel, under remote and double click it.

How to show tags in the history view of egit?

I have a repository with some dangling commits:
o (master) commit 3
o commit 2
o
| o (tag: danglings) dangling commit 2
| o dangling commit 1
|/
o commit 1
o initial commit
I have tagged the lastest dangling commit with a tag, to make sure it doesnt get lost, just in case i need it at some point in the future.
However, when viewing that repository in egits history, i dont get the dangling commits. They are simply not shown. When i create a branch that points to dangling commit 2 the two commits including the tag are shown.
How to prevent that? I want to see everything, not only branches in egit's history view.
EDIT: Added a nice screenshot montage:
The first one shows master checked out, and no dangling branch exists. Of course, the dangling commits and the dangling-tag exist!
On the second one i created a branch called dangling that points on the commit tagged with the tag dangling and checked it out.
Note that the view doesn't change (except for the bold written master and the HEAD getting moved) when i check out master on the second picture.
robinst mentions in the comments:
This was simply a bug in EGit and happened only with annotated tags, please see bug 417655 which proposes the fix in org.eclipse.egit.ui.internal.history.GitHistoryPage.
Target Egit 3.1
Original answer:
This Egit exercice discusses the History View:
Consider the different button available in this view:
:
That tutorial mentions:
TIP: If you got lost with the different filters and the history doesn’t show what you expect, set it back to show everything.
Therefore make sure that 'Show all branches and tags' (a) is turned on and 'Show all changes in repository' (e) is selected.
Those two buttons should potentially show you all reachable (that is at least tagged) commits.
The "Filtering settings" section of the Egit User Guide is clear:
The next four toggle buttons in the view toolbar control how the displayed commits are filtered with respect to the current input.
The buttons are working as radio buttons, i.e. one of the four buttons must always be down.
If the "Repository" button is down, the commit log is not filtered and shows all commits reachable from the currently checked out branch (or all commits, see below about the "All Branches" action)
If the "Project" button is down, the commit log is filtered to show all commits which affected any of the resources in the project containing the current input
If the "Folder" toggle is down, the commit log is filtered to show all commits which affected any of the resources in the parent folder of the current input
If the "Resource" button is down, the commit log is filtered to show only commits which affected the current input; the view menu item Show > Follow Renames allows to toggle whether renames of the selected resource should be followed by this filter
Note that not all combinations of filter setting and current input are meaningful; for example, if the current input is a project, the "Project" option is in fact the same as the "Resource" option.
But the "All branches" sections add:
This toggle activates the "All Branches" mode.
By default, only those commits are shown in the commit log that can be reached from the currently checked out commit, i.e. the Commit Graph ends with the currently checked out commit and newer commits are not shown.
If this button is down, all commits will be shown in the commit log.
In your case, I am not sure commits are show when referenced by a tag alone.
Only branches make those commits visible.

Animate commits inside IDE to learn codebase, an idea?

Go back in time in the codebase and see the commits as an animated explanation of how the codebase was formed. a great way to get into a open source project?
For insance if you could play this inside Eclipse, so that the comments the time and the reason for the commit become clear.
Is there such a thing?
A static (i.e. non-animated) version of "going back in time" is EGit blame (annotations):
Selecting the Team > Show Annotations action on file selections will open the editor and display an annotation ruler with commit and author information for each line in a file.
Hovering over the ruler will display a pop-up showing the commit id, author, committer, and the commit message.