My company has just begun using BitBucket with Mercurial for version control and I am having a heck of a time integrating it locally with Visual Studio 2010. I can easily create a folder on my local system and clone the BitBucket repository using TortoiseHg and it brings down all the files appropriately. However, when I try to create a Visual Studio project in the same folder, it insists on creating it's own sub-folder for the project files, leaving my version controlled source files out of the project. When I try to do it the opposite way, creating my solution in Visual Studio first, TortoiseHg will not let me clone my repository into the same directory, saying that it needs a new folder. All of my google-foo seems to be coming up fruitless.
Anyone have a clean way of setting up a cloned repository from which to work locally in Visual Studio using Mercurial and BitBucket?
You can
Create your Visual Studio project.
Right-click the project folder and choose TortoiseHg -> Create Repostory Here.
Add and commit files in TortoiseHg.
Push the repository into a new empty repository on Bitbucket. To push, you use the synchronize view and add a new path to the repository. Name the path default and it will become the default push and pull path.
The important point is that you can always push into an empty repository. This is how you copy a repository you've worked on locally to Bitbucket: create a new empty repository online and push to it.
Related
Seems like somewhere in the copid project folder there must be a file that specifies the URL of the original project repository. If I could find that, I could replace the URL with the URL for the new online Subversion repository.
I've tried the Switch command in Visual SVN, but it seem only to allow choosing a different folder within the original repository, not choosing a completely different repository.
Answer: Find the .svn folder and delete it. Then open the project in Visual Studio. Now you are free to add the project to a new repository.
I've been trying to setup a GitHub repository for a xaramin iOS project that I'm doing on my mac.
When creating the project, this is the settings I chose
Setup Image
However on I haven't been able to push to the GitHub repo I want to, I've tried to follow Microsofts guide https://learn.microsoft.com/en-us/visualstudio/mac/set-up-git-repository but it hasn't worked due to Publish in version control being greyed out
Or, if your project is already bound to a git repository, simply add the GitHub remote and push it there.
git remote add github URL_TO_GITHUB_REPO
git push github master
Afterwards, Visual Studio should allow you to push to Github as well as any older remotes that were added locally.
You can always remove the existing remote if you want to:
git remote remove origin
git remote rename github origin
See also: https://stackoverflow.com/a/52052063/736079
Before publishing your project to GitHub from Visual Studio, you must remove any source control :
If you have an existing project that is
not already in version control, use the following steps to set it up
in Git
Removing the .git folder and .gitgnore file should be enough. Then the "Publish in version control..." menu will be available (you might need to restart Visual Studio).
Source : https://learn.microsoft.com/en-us/visualstudio/mac/set-up-git-repository?view=vsmac-2019#publishing-an-existing-project
I have an existing Visual Studio 2013 solution, and I want to put it under source control using VisualSVN Server. I installed VisualSVN Server and created a new blank repository. Their Getting Started page doesn't explain how to add a folder structure and files to the repository. I am expecting an import or add files option when right clicking on the repository node in the UI.
How do I add an exiting root folder and all its files and folders of a Visual Studio solution to a repository and make it ready so any SVN client can check out files from it? I am planning to use TortoiseSVN as the client.
You need to install TortoiseSVN and check out a working copy of the repository. Copy from solution into the working copy, select all files, and make a rightclick and select TortoiseSVN -> Add.
Commit the changes and now you have the data added to the repository.
I came from Eclipse background and I am apparently missing something.
There is an existing GitHub project with JS code in it and I would like to start adding TypeScript nature to it, one type at a time.
I have followed this tutorial to clone project from GitHub to my "local git repository". Now the Team Explorer window displays it as local repository and I can commit changes etc but it's not a project and I don't know how to open it as a project (I want to open it as TypeScript project).
The workflow I was used to from Eclipse would simply be New -> Other -> SVN -> Checkout Projects from SVN that is automatically followed by New Project Wizard.
How do I clone existing JS project from GitHub and make it a TypeScrip project while keeping the existing folder structure?
EDIT: I am using Visual Studio Express and I am limited to the native Git extension.
What I typically do in this situation;
Clone repository using Git in Visual Studio; or use GitHub for Windows and Clone in Desktop from the Git project's web page. This will create a directory (repository) with the project files where you specify.
In visual studio, File->New->create a new project from existing code. From the wizard, select C# or C++ (whatever your choice it does not really matter)
The wizard requires a project file location: give the location of the Git folder that contains the project files (where you cloned the project's repository).
The Wizard requires a unique project name, for example you can use the name of the Git project with VisualStudio (or VS) appended to the end.
Git will now be in sync and you will be able to see all the git files. Making changes will check them out and allow you to push them to the project etc...
***** By default Git will want to check in the newly created .csproj file that Visual Studio creates to allow you to open the project in Visual Studio. You will just want to drag this into the excluded changes section because most likely the project in question will not be using Visual Studio.**
I solved this by opening the site as a website. File->Open->Website.
No Project Files/Solution files required. It just opens up the folder in the solution explorer.
To make it a typescript project, just add a tsconfig.json file to the directory.
Do you have any code in that repository yet that you want to open? I'm guessing not in which case you need to create a new VS project (just like you'd create a new Eclipse project and have it in your workspace)
Go to File, New..., Project... and pick the project type that you want. Give the project a name and set the location to be a folder INSIDE the folder that you cloned your Git repo to earlier (i.e. c:\mycode\mygitproject). Also give your solution a name. A "Solution" in Visual Studio is a wrapper for the projects inside it, kinda like the closest thing to a workspace or a working set in Eclipse but not quite the same thing.
Then Visual Studio should then be smart enough to pick up that this is in Git repo and allow you to commit locally as well as push/pull to GitHub etc.
Finally, while I work with the team that created the Visual Studio Tools for Git, I'd still highly recommend that you get hold of a command line should you want to do some more powerful stuff with Git other than simply committing code, push/pulling changes and branching or merging branches. If you are working against GitHub then you might also want to install GitHub for Windows which will bring some Git tools with it or you can install Git for Windows and also install Posh-Git separately. All of these things work together and give you the maximum power of Git but you can pick and choose the tool that works best for you. You'll probably find a workflow of Clone using GitHub for Windows, commit/push/pull/branch/merge in VS and then Posh-Git if you do more advanced stuff or want to hand-tweak settings.
Newb to Ankhsvn and Ubersvn integration.
I have existing web projects built in Visual Studio 2010 and am attempting to add them into a newly created repositories. The issue I'm having is trying to configure the working local directory. I've got my projects contained in various folders on my machine but it seems Ankhsvn will not let you change the "Local Folder" (which I'm assuming is the working folder) on your machine, it only gives selected options in a dropdown. I know Visual Studio generates it's own solution file in the standard directories (my docs../vis stud../projects/...) but that is not my working directory which it seems Ankhsvn is fixed in.
I don't want to have to move my projects around (and probably don't have enough space on my c: drive anyway). Does someone have any insight on how I can configure the local folders ankhsvn and Ubersvn can work out of?
Using Windows 7 64bit if that has any bearing as well. Our svn repository is hosted externally.
UPDATE
Well I haven't heard any feedback yet on this so I basically went ahead and used the following methodology to get my files into the repository:
1) Used TortoiseSVN to add the files to the svn repository (with TortoiseSVN installed, right click on the folder you want to add, TortoiseSVN -> Import and basically add in the repository URL ad go about adding in folders and files as desired.
2) next step was to then open Visual Studio 2010 and open the given web project folder and then go File -> Subversion -> Open project from subversion. NOTE: make sure when you open that you select the correct folder to import to. It should be one level above the given folder you selected.
3) after the import, all my files appeared as in conflict. I basically just commited the files and the issue went away.
So I now have my project hooked into svn and working through Ankhsvn but has to use TortoiseSVN to get it done...hmmm
To administer the repository in uberSVN you need to make it aware of the repository. The easiest way to do this is to create the repository within the uberSVN admin page, but you've already done that bit, so we need to make uberSVN aware of it.
To do this:
Create a Dump file based on your manually created repository
Login to uberSVN as an System Admin or Repository Admin
Click on Repositories
Click on Add
Enter a Repository Name (which will enter a Location automatically)
Click Next
Click Import From Uploaded Dump File or Import From Dump File Located On The Server
Select the Dump file in question
Click Done
Your repo will now be brought underneath uberSVN, loaded into a newly created Repo sat in the /uberSVN/repositories storage location.
From there you just continue as normal with your preferred subversion client.
Know this QA is old but thought worth updating.
Got a solid, reproducable method for adding projects into remote UberSVN repository from Visual Studio 2010...trial and repeat seems to work consistantly on my side. Here goes
Go to remote UberSVN server, Login
Create Repository
"Your Repository Name"
Added users to repository
Created Visual Studio project (File -> New Project) in similar ubersvn structure…in this case
In windows explorer, created folders D:\\\trunk\
In Visual Studio, create new project, uncheck “Create directory for solution” and I set the “Name” to
"Your Project Name"
In the first solution and subversion create phase, I checked off “Add to Subversion”
Created project and the subversion repository selection popup came up.
typed in the new repository url
http://"your UberSVN Repository URL"/"Your Repository Name"/
Below the Repository URL, I selected the repository “Database” image and then I clicked “Create Folder”
NOTE: When I did again, it seemed that there was already a “trunk”, ”branches” and “tags” folders generated under the repository database -> I clicked on the trunk folder).
If the folders from above notes do not exist, I typed in “trunk” as new folder and then the proper Project url appeared in the “Project will be created in:” section at the bottom of the popup (
http://"your UberSVN Repository URL"/"Your Repository
Name"/trunk/"Your Project Name"/
)
Clicked OK
Started copying files from existing website/project to new project
Once all files are in and no more errors exist, start to do initial commits
Visual Studio 2010 NOTES:
May have to regenerate designer files from older visual studio 2008 projects. Right click on the web form page you want to convert to “Web Application” and it will autogenerate the designer file for the given webform (web page)
Will have to add in references from the bin folder for any dlls needed in project
If bringing over classes from another project (i.e. in App_Code folder), need to right click on each (or select multiple) and go to properties -> Build Action and change from “Content” to “Compile”