I am looking for the equivalent of git log --pretty=fuller in Tortoise git. https://tortoisegit.org/docs/tortoisegit/tgit-dug-showlog.html for example consistently just says "date" while there are two dates -- and Tortoise Git actually allows you to alter one of them.
You can open the context menu on the columns (as in Windows Explorer) and select the columns you want to see (or change the order or the sizes).
Related
I've moved a function from one file to another, and I'd like to compare the moved version to the original, so I'd like a diff with the source file on the left and the destination file on the right. Using TortoiseGit I can figure out how to diff two files in the working tree, or diff one file across multiple commits, but not both at once. Is it possible without checking out the two files?
There is a way to do this (but not an obvious direct one):
Open the log dialog and navigate to the commit/file you want to diff. Drop it into Explorer or select "Save revision to..." and then select the two files you want to compare and select TortoiseGit -> Diff.
If the file is modified or was already committed in the meantime then you can also open the log dialog (make sure so that both files are in the history, e.g., by opening the log on a common directory). Select the commit of the first file and click on "Mark for comparison" in the context menu of the file, then navigate to the commit of the second file and select "Diff with ...".
UPDATE:
Starting with TortoiseGit 2.10.1.0 (preview release) you can select a file in Explorer and mark it using TortoiseGit -> "Diff later" and compare a file to this file from Log Dialog or Repository Browser using "Diff with ..." as described above.
I'm a bit new to TFS. One common operation which is very easy with every other source control I've used is comparing two different revisions. Say you have 3 revisions. Revision 3 is my current local copy. There was some regression introduced with revision 2(or whatever). So, I need to see what was changed from revision 1 to revision 2. I'm not concerned about what was changed in revision 3.
How do I do this in TFS?
If you use the source explorer to 'View history" on a file, you will see a list of the verions in TFS. Then you can select two versions. Then right-click to compare the two versions.
You can right click on the File and click "Compare...".
There you can set the same Server Path (e.g. "$/Project/Main/File.cs") and use the Changeset "Type:" and set a Changeset Id on the Source and Target.
Actually, one of the things I absolutely love about TFS is the flexibility to compare various versions of files (I'll admit, I love the flexibility but the actual compare tool? Not so much).
You'll have to forgive any mistakes, it has been a while since I've used TFS but I still remember the general idea.
In the solution explorer if you right click the file and click compare, you will be presented with compare dialog. From here you select the two files you want to compare. Make sure both of them point to the server version path.
Under the "Source Version:" in the Type: dropdown, select "Changeset" (or "Date" if you feel confident enough). You should see an elipses that allows you to search for the changeset. You will now be able to select your changeset from history (you may need to press a "Find" button or something, I can't remember by heart). Select Your revision 1 (whatever changeset id that is) and "ok" out of the changeset selection.
The "Target Version" frame will be disabled if the Target Path is pointing to a local file (likewise for the "Source Version" and "Source Path"). So make sure your paths are all pointing to the server versions.
Under "Target Version:" in the Type: dropdown, also select "Changeset". Now using the same steps as above, select the revision 2 changeset.
Finally click "Compare" and enjoy!
If you are using Team Explorer inside Visual Studio, you can go to the Source Control Explorer window and select a file, then view history. Choose 2 versions and right-click to compare.
I want a nice graphical version of git log -p some/file.rb on my Mac. Tower 1.2 boasts a new File History view, but that just shows two dropdowns with SHA1s to compare; it's slightly less useful than a MediaWiki "compare versions" history (it doesn't even show commit messages).
I can't find anything in GitNub or Gitti that does this. GitX does it about as well as GitHub, but it leaves me wishing I could just scroll up and down to see the diffs instead of having to click each commit. Is there a better tool?
I would give SourceTree a try. It has a nice and powerful GUI.
I am used to and like how Netbeans shows file history, so I just create a project in netbeans with the option PHP Application with Existing Sources, now you can enjoy per file history and graphical diff of each commit, like so:
Locate your file in projects pane, on the left
Right click > Git > Show History
Choose Diff From 2 buttons on the left, Summary and Diff
Now tap each commit
When using Git with TortoiseGit: Does somebody know how to revert a single file(or a complete repository) to a previous revision?
For example I have a repository containing multiple files. One file exists in three revisions (1 ; 2 ; 3). Now I want to change from revision 3 back to 2.
TortoiseGit offers a "Revert" function in the "Show log" dialog which allows to jump back to a specific revision, but this will revert your whole repository instead of a single file.
Also once I have reverted something, I don't have a clue how to undo the revert and jump back to the newest revision.
From the command line: git checkout is probably what you want.
The documentation shows an example of:
$ git checkout master~2 Makefile
to revert Makefile to two revisions back in the master branch
From within TortoiseGit (via Windows Explorer) it looks like you can do this with the following steps:
Navigate in Explorer to the folder where the file is.
Right-click on the file you want to revert, choose Show log from the TortoiseGit context menu
In the top section ("graph") select the revision that has the version of the file you want to revert to
In the third section (file list) right-click the file and choose Revert to this revision
You should get a message like 1 files revert to e19a77
It is also possible to get a specific file:
Right-click on the file
Choose the menu item: Git Show Log
TortoiseGit show a dialog with a list of all revisions
Click on the prior revision (2)
In a list in the bottom of the dialog it shows all the files associated with the commit
Find the file you are looking to view
Right-click on that file and Save Revision To
This will save that previous revision of the file with the commit number concatenated on the file
For example:
- original file is file.txt
- revision 2 will save as file-67b51a8.txt
I'm using TortoiseGit v2.2.0.0
In TortoiseGit the answer is to right-click the project folder and click Show Log, then right-click the change you want to roll back to and click Switch/Checkout to this... . It will let you then proceed from that weird place in the commit stack, or branch in case you plan to commit and want things to stay sane.
Updated my answer, based on these comments:
by Alexander.
by mlibby
by Chris Moschini
Suppose the working tree is clean and you want:
Checkout some file(s) of its previous revision
Testing
Revert to current revision
Checkout some file(s) of its previous revision
(a) Right click the file you want to revert and Show Log for that file
(b) Right click the file in file list and perform Revert to parent revision
(c) repeat (a), (b) until you get all files you want.
Testing
Revert to current revision
(a) perform Revert... in context menu of explorer
This way, you can choose the file(s) you want to revert.
(b) or this quick way: perform Reset Hard in Log dialog
This way, all changed files revert. (=> Lost all working dir changes)
(Tested on TortoiseGit 1.8.16.1, GfW 2.6.4.windows.1, Win 10 64bit)
For Tortoise Version 2.3.0:
You can do it in several ways, but fastest i think is that:
Right click on the file
Click the menu option "Diff with previous version"
Right click on the left (previous) version of file
Click the menu option "Use this whole file"
Save the changes (ctrl+s)
Are there any good techniques to help us know which branch (or trunk) our working copy is from? We recently converted to Subversion and we're using release branches. I had two developers commit changes to the release branch that should have been committed to the trunk. We're using CI (TeamCity), so I recognized the problem right away and was able to revert the changes but I'd like to prevent it from happening again. From within Visual Studio, especially, it's easy to make a mistake and commit to the wrong branch.
We're using TortoiseSVN and AnkhSVN.
Edited to add:
Just to clarify, I'm looking for a method to prevent careless mistakes, I already know how to find this information. There are two careless mistakes I'm trying to prevent:
Doing work on the wrong branch. If this is caught before commit, the developer has to merge the changes back into the correct branch.
Committing to the wrong branch. This combines the pain of point 1 with having to revert the changes in Subversion.
Edited to add: We just made the switch to the VisualSVN VS plugin and it has a toolbar that displays the path of the current working copy. I really like the reassurance that I'm working on the right branch.
Perhaps you should consider using a pre-commit hook: http://svnbook.red-bean.com/nightly/en/svn.reposadmin.create.html
Then you could do something like only approve checkins that have 'for release' in the comments for that particular branch or something like that and return an error message otherwise.
In AnkhSVN (in Visual Studio) the project url of your working copy is from is displayed in the 'Working on' field of the Pending Changes Window (View->Pending Changes).
The url of a file/folder is also displayed in the Visual Studio project window when you select a file in the Pending Changes Window or Working Copy Explorer (and in many cases even when you select a file in the Solution explorer; but this depends on the project type).
[Update: I just added AnkhSVN issue #581 for extension of the commit dialog.]
Tortoise SVN adds columns to the Windows Explorer view. In "Details" mode, right-click on column headers to get a list of available columns, at the bottom, select "More" to get a dialog of all available column types.
SVN short URL should quickly show you what the location is in the repository.
But this doesn't appear to work under vista ...
Right click the folder, move to the subversion tab, there it says the project it's linked to.
Also, in the commit dialog, it says so at the top of the dialog.
From the working directory:
svn info
URL will contain the branch your working directory points to.
<EDIT> Seeing how many people dislike the command line, the closes thing I found from TortoiseSVN is the "repo browser" which seems to use the selected branch as your starting path in the repo. </EDIT>
Avoid re-using working copies. If you're working on 2 places in the repository, have 2 working copies, named appropriately, like: Project-trunk, Project-release.
Here is a simple idea which might help:
Create an empty text file named "branch_XX" (or any name) and add it to your branch.
commit this and then when you switch to the trunk, the file will not appear in the solution explorer.
It sounds stupid... but it does the trick.
I really hope they will add something that might mark what branch we are using without going to other windows.
In AnkhSVN (in Visual Studio), right click on your project/solution, then Source Control -> Subversion -> Select in Repository Explorer. It will automatically select the branch you're currently working on (i.e. the branch you're switched to).
I don't think that the accepted answer for AnkhSVN works for Projects, since I always see the same URL in the "Pending Changes" even after I use the option "Switch Project" on a project.