How do you create a worktree with TortoiseGit? - tortoisegit

Now that TortoiseGit has support for worktrees, how can I go about creating one through the UI?

Starting with TortoiseGit 2.14 there is an enhanced support for worktrees.
There is an option on the context menu and you can also create worktrees by using the drag'n'drop feature of the windows explorer when you drag a repository root to create a new worktree.
cf. https://tortoisegit.org/docs/tortoisegit/tgit-dug-worktrees.html
Before that version, there was no special support for creating/managing worktrees.
However, TortoiseGit supports existing worktrees for daily operations (overlays, log, merging, etc.) which are created using the CLI.

Related

Using SVN, how do I selectively create a patch file?

I have a codebase with several changes in it that are best split up into several commits.
In git, I would use git add -p to select the changes I wanted from each file and create a commit and pull request based on those.
I'm new to SVN and I'm wondering about the best way to achieve this? It looks like I can do file-level selection, but not changes within those files?
I'm using TortoiseSVN as my local version control tool, but I'm happy to use another tool (has to run on Windows) if there's one that will do what I want.
This is something you won't get from SVN. Separating changes in your working area into multiple commit can only have a file granularity. You can't split changes from the same file into several commits.
So I'd say you should instead give a look at how git-svn works. It allows you to use Git over an SVN repository, with some limitations. You'll use git dcommit to push to the SVN repository for example. You must use a rebasing strategy over merging too. But otherwise, you get colored diffs, stash, rebasing, proper handling of multiple branches, proper formatting of patches by default, etc.
If you already know git, this will give you more, for less annoyance.
It looks like I can do file-level selection, but not changes within those files?
This is easily possible with VisualSVN plug-in for Visual Studio 2017. The feature is called QuickCommit and it helps you partially commit selected changes in a file.
Use the Commit this Block and Commit Selection context menu commands in the Visual Studio editor.
Here is an animated screenshot:

What's going on with Add to Source Control in VS 2017?

I had no source control set up for my solution.
But when I right clicked it and chose 'Add to Source Control', it spewed out the following output, which seems to be setting it all up and creating it automatically in the projects own folder.
A new Git repository has been created for you in C:\Users\Me\Documents\Sites\MySolution.
Opening repositories:
C:\Users\Me\Documents\Sites\MySolution
An existing Git repository was found in C:\Users\Me\Documents\Sites\MySolution.
Commit d59ef659 created locally in repository C:\Users\Me\Documents\Sites\MySolution
This seems like magic to me. I've dabbled in version control but have never used it seriously as most of my projects are personal and maintained by me alone. Has this option always been available?

Source Control on already existing project Xcode

I've read that developers really need source control. Now I never used it before and I'm a bit lost with my existing projects.
How do I setup it?
There's already a File path inside of it, but it goes to nothing? I don't even know what it does in there.. I want a local git for my own. I found how to set it up with Terminal. But I think there should be a right way on doing this with Xcode and not with Terminal?
I'm sorry to say that Xcode does not have an option to place an existing project under version control. You can however use GitHub for Mac which will allow you to do this. It also has convenient merging tools and lets you push your code to GitHub.com if you like, all at the touch of a button: https://mac.github.com
It's easy enough to create a git repo from the command line though: open Terminal and navigate to the root folder of your project. Then type the following:
git init
git add .
git commit -m "initial commit"
Note that this approach as well as GitHub for Mac will version control every file in your project - which is not what Xcode does when you start a new project with Git enabled. You may run into trouble because your user interface state changes once every second - which can make committing and merging difficult.
The following article discusses this in detail:
http://pinkstone.co.uk/how-to-place-an-exiting-xcode-project-under-version-control-with-git-and-ignore-files-you-dont-want-to-track/

Git Extensions usable with SVN repos?

Can Git Extensions be used without issues (or at least, with very few ones) as a SVN client? I've no problem using the command-line git-svn, but in some cases (picking lines/hunks to commit, for example) I'd rather use a GUI client.
If there are issues, I'd like to see them along with your workarounds/solutions.
As a way of an updated answer (I think this question was asked in 2011), I just started using Git Extensions for a project that uses Subversion as the repo, but I wanted to use Git locally. Learning my way into it, Git Extensions has GUI based actions for commands like SVN Fetch, SVN Rebase, and SVN Dcommit.
So, if (and I don't know because I wasn't using it in 2011) Git Extensions didn't support Subversion repos in 2011, it looks like they have that support now.
Here is an example (see red highlights at bottom):
So, to better answer your question, yes it does have support as an SVN/Git client.
git-svn creates a repository that behaves as a regular Git repository unless you are doing one of it's special operations (dcommit etc.). Thus, it is perfectly fine to interact with that repository via any external Git client as long as you use it to do things you'd normally be able to do from the command line without screwing up git-svn. (E.g. you wouldn't want to try to rebase upstream commits, GUI or not.)
(You will, of course, still have to use the command line for the special git-svn commands, unless you find a GUI that supports them.)
As alluded to by #matth, SVN support was removed from Git Extensions v3.00. However, there is a plugin (mast-eu/GitExtensions.SVN) you can install to add basic git svn commands to Git Extensions. To install it, open Plugins > Plugin Manager and browse for "gitextensions.svn".
Once installed, SVN commands are added to menu bar.
Picture of menu bar with commands

VSS Deprecated Files

We are using VSS for version control (changing to another version control system is not an option right now), and are occassionally running into issues where a file has been completely deprecated with its functionality split into other new files. For historical archival reasons we need to keep those files in the version control sytem. Is there some way to clearly mark them as deprecated and no longer used?
Delete the files?
Deleting does not remove the historical versions - there is a separate command Destroy to do that.

Resources