Reopen commit window - tortoisegit

I often make multiple commits at once:
Changed files:
a.txt (added)
b.txt (modified)
c.txt (deleted)
My typical workflow (jump to the end of the question for TLDR):
Open the repo in Explorer
Right-click somewhere, choose Git commit -> <branch>
Select a.txt, type message Add information about letter A
Commit
Go back to the explorer Window.
Right-click somewhere, choose Git commit -> <branch>
Select b.txt, type message Fix inaccurate information about letter B
Commit
Go back to the explorer Window.
Right-click somewhere, choose Git commit -> <branch>
Select c.txt, type message Letter C has been deprecated and will be removed
Commit
Go back to the explorer Window.
Right-click somewhere, choose Git commit -> <branch>
Nothing left! Done.
Is there any possibility of having a Reopen commit window after commit or even Reopen commit window after commit unless no changes left?

With the TortoiseGit commit dialog open, click the down arrow on the right of the Commit button and choose the ReCommit option. This will leave the dialog open until you close it manually.

Related

Generate a diff of all changes made in a branch?

I am not very experienced with Git but I think this is a TortoiseGit-specific version of: Git diff between current branch and master but not including unmerged master commits
When working in a feature branch, I would like to see:
all changes I made to a file since branching
all files I've changed in the branch
But specifically, how I can do this in TortoiseGit rather than on cmd-line?
Open the Log
Select both branches
To make this easier you can click on the "Branch selector" in the upper left
Select both branches there, on "OK" select "branchA branchB"
On the log you see now both branches, select both branches (the latest commit of each branch)
Open the contect menu and select "Compare"
Open Diff options and select "Use common ancestor"

How can I get my stashed files back to where it was before stash?

I got a pop-up in my git "The current working tree is not clean. do you want to stash the changes?" It had two options stash and abort i selected "stash" now I don't see my previous changes in my commit list how can I get my changes back? Please answer emergency!!!!!!
Open the context menu in explorer on the repository. Then go to the TortoiseGit submenu and select "Stash Pop".
cf. https://tortoisegit.org/docs/tortoisegit/tgit-dug-stash.html
use below command to get back the stashed files :
git stash pop

Context menu for folder does not contain "Add to ignore list" tortoisegit

I use TortoiseGit 1.8.16. But the context menu for a folder does not contain the "Add to ignore list" option.
Right click on folder in repository. I expect to see "Add to ignore list" in context menu. This item is not in the context menu.
How to add file in ignore via TortoiseGit?
In TortoiseGit the context menu is configurable in two ways.
1) You can configure which entries to show directly on the context menu (and not in the TortoiseGit submenu). This can be configured in TortoiseGit settings -> Context menu.
2) You can hide entries by default, so that those are only visible if you hold the Shift-Key while opening the context menu. This can be configured in TortoiseGit settings -> Set Extended Context menu.
In your case, I suppose that the entry is hidden. Btw. the "Add to ignore list" is only available for unversioned folders (otherwise "Delete and ignore is available").
It is also possible to ignore items from the context menu of the commit dialog.
See the TortoiseGit manual.
Note on Windows 11 the context menu settings choice is different.
1- R.click on the required folder and select Settings:
2- At General>>Context Menu : Check "Add to ignore list", then click OK
3- Icon will appear at the context menu:
For ignoring files, you Can do:
$ git rm -r --cached gen/ bin/
$ echo "gen/" >> .gitignore
$ echo "bin/" >> .gitignore
I can do it with these steps below!
Delete the file you want to ignore first. You can undo it later to get it back from the recycle bin. Or you can move it to another folder temporarily.
Do git commit until the commit window opens. Don't commit!
You'll see the file you want to ignore is going to be committed. Right click on the file and you'd see the option "Add to ignore list".
Click it! Choose what kind of ignore you exactly need, and done!
I know this is really old but I recently had this issue and it was because the directory had been set up for git previously then removed by deleting the .git directory. When re-instating it as a Git Repo the old .gitignore file came back and the directories I was trying to ignore were already listed in it.
To test the theory I removed all entries from the old .gitignore file, saved and the "Add to ignore list" was back in the context menu

How to remove an unused GIT branch in Xcode?

I can see how to create a branch, but I would like to remove one that I will never use. There doesn't seem to be such functionality in Xcode, so I tried in terminal doing
git branch -d BugFixes
but no luck.
You can delete git branches in Xcode. Choose Source Control > WorkingCopy > Configure WorkingCopy, where WorkingCopy is the name of your working copy, which is usually the name of your project. A sheet opens. Click the Branches button at the top of the sheet. Select a branch and click the minus button at the bottom to remove the branch. Note that Xcode does not let you remove the current branch.
Xcode 9 Update
Apple moved the user interface for branches to the source control navigator in Xcode 9.
To delete a branch, select it, right-click, and choose Delete. You cannot delete the current branch.
please try:
for local: git branch -D BugFixes
for remote: git push origin :BugFixes

Git (TortoiseGit) - How to revert a single file to a previous revision and then undo the revert?

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)

Resources