• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Visual Studio - Set up source control on NT8 project

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Visual Studio - Set up source control on NT8 project

    NT Forum,

    Continuing from the posts by @dalebru and @MicroTrends (Developing in VisualStudio), please provide step-by-step guidance on how to set up Source Control (Git) for NT8 via Visual Studio 2013 - Team Foundation Server (TFS).

    I imagine this is simple... when you know how (just it took me weeks to sort out after I botched Git setup for NT7).

    Thanks & regards
    Shannon

    #2
    Thanks for your suggestion however there is a plethora of documentation on working with remote repositories available already and there is nothing specific to NinjaTrader that I could see adding any value versus what is already available through Visual Studio/MSDN tutorials and other 3rd parties. Further to that we're not going to force people to use Git when there is SVN, Mercurial, TFVC, or even Dropbox/Google Docs can be used as source control.

    If a community members wants to provide documentation for this and post on the forums that is fine- but we as a support community cannot get caught up in supporting all the problems that arise as a result of using source control.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Mathew,

      Thanks for your response. I appreciate there are many approaches to source control and it is unreasonable to expect a guide for each.

      Having muddled through source control with NT7 (problems of my own making due to trial and error), I was hoping for a known solution. Certainly from the "Put an existing solution under local Git version control" section of MSDN Set up Git on your dev machine, the process should be simple. Noting the tip to "first move the solution to the TFS Git default location..." should be ignored in the case of NT8. I am just cognizant of the mess should this simple process not work as expected.

      Any experience from the forum is welcome.

      Shannon

      Comment


        #4
        NT Team,

        The progress to date....

        Following the steps described in "Put an existing solution under local Git version control" had some success.

        Following the steps:
        1. Open your solution... CHECK (from NT8 | NinjaScript Editor | "Open project in Visual Studio")
        2. Add solution to source control... CHECK (Solution 'NinjaTrader.Custom')
        3. Choose Git from Source Control Dialog box... CHECK
        4. Commit files... PROBLEM

        At this point, the example from MSDN shows many folders and files located under Team Explorer - Included Changes (screenshot attached). I would have expected to see the folders located in "C:\...\Documents\NinjaTrader 8\bin\Custom" (e.g. Indicators, Strategies) in the Included Changes list. However, these folders are not listed under Included Changes (or Excluded Changes or Untracked Files).

        Further, I would have expected the files ".gitattributes" and ".gitignore" to be added to the folder "C:\...\Documents\NinjaTrader 8\bin\Custom". These files are not present.

        From these issues I'm lead to believe the Git local repository was not created.

        I am at an impasse. Any assistance from the forum would be appeciated.

        Regards
        Shannon
        Attached Files

        Comment


          #5
          Originally posted by Shansen View Post
          NT Team,

          The progress to date....

          Following the steps described in "Put an existing solution under local Git version control" had some success.

          Following the steps:
          1. Open your solution... CHECK (from NT8 | NinjaScript Editor | "Open project in Visual Studio")
          2. Add solution to source control... CHECK (Solution 'NinjaTrader.Custom')
          3. Choose Git from Source Control Dialog box... CHECK
          4. Commit files... PROBLEM

          At this point, the example from MSDN shows many folders and files located under Team Explorer - Included Changes (screenshot attached). I would have expected to see the folders located in "C:\...\Documents\NinjaTrader 8\bin\Custom" (e.g. Indicators, Strategies) in the Included Changes list. However, these folders are not listed under Included Changes (or Excluded Changes or Untracked Files).

          Further, I would have expected the files ".gitattributes" and ".gitignore" to be added to the folder "C:\...\Documents\NinjaTrader 8\bin\Custom". These files are not present.

          From these issues I'm lead to believe the Git local repository was not created.

          I am at an impasse. Any assistance from the forum would be appeciated.

          Regards
          Shannon
          Here is a 5-minute video I recorded for @Shansen that he thought others might value: http://screencast.com/t/ItUmUPdf

          But FYI, I actually use visualstudioonline and TFS
          (free for small shops: https://www.visualstudio.com/en-us/p...ricing-vs.aspx)
          because I normally have my .sln and other projects OUTside of the ..\Documents\NinjaTrader 8\bin\Custom file structure while the NinjaTrader.Custom project stays (necessarily) where it is installed. I haven't figured out how to accomplish that with git.

          And now I've probably told you more than I know.

          Comment


            #6
            How do you guys handle when you upgrade to a new version of NT? When you upgrade, all the pre-installed indicators change their timestamp from what is in source control.

            Comment


              #7
              Originally posted by GrumpyTrader View Post
              How do you guys handle when you upgrade to a new version of NT? When you upgrade, all the pre-installed indicators change their timestamp from what is in source control.
              For a major version (NT7 to NT8), of course I'm starting over with a new solution and new source control project.
              For a minor version, like .26 to .27 -- well, I never edit the NT-supplied files. And when TFS does its DIFF and sees that no text was changed, it seems to ignore the fact that there is a new date stamp.

              Comment


                #8
                Thanks, I enjoyed webcast. Had problems with moving from github to bitbucket - this URL helped:
                https://help.github.com/articles/cha...-remote-s-url/
                I have a question - why do we need to copy solution to another repository (possible location - the webcast got broken after 5 minutes). Can't I just use the master repository, update from visual studio, compile with NinjaTrader and commit once in a while - is there some issue I don't see now?

                And another question - let's say I want to use another PC to work with same repository. I will install NT8 there - but how do I get files from this repository to my other PC without messing up folder structure and without having conflicts with files on the other PC after clean NT8 install (assuming I already made some changes - added some files to repo).

                Thanks

                Comment


                  #9
                  Originally posted by music_p13 View Post
                  Thanks, I enjoyed webcast. Had problems with moving from github to bitbucket - this URL helped:
                  https://help.github.com/articles/cha...-remote-s-url/
                  I have a question - why do we need to copy solution to another repository (possible location - the webcast got broken after 5 minutes). Can't I just use the master repository, update from visual studio, compile with NinjaTrader and commit once in a while - is there some issue I don't see now?

                  And another question - let's say I want to use another PC to work with same repository. I will install NT8 there - but how do I get files from this repository to my other PC without messing up folder structure and without having conflicts with files on the other PC after clean NT8 install (assuming I already made some changes - added some files to repo).

                  Thanks
                  Since you aren't doing any fancy forking or branching, I think you'll need only one repository on BitBucket. You would set up Visual Studio the same on both machines and link both to the same repository. You would sync changes from one PC to the BitBucket repository then sync again to the second PC. You'll want to maintain identical folder structures on the two machines and avoid making any change to an NT-installed file.

                  Comment


                    #10
                    I've done it a bit different than described below. I use the windows source control instead of git. I also only check in my custom code instead of the entire project. The main difference is you need to do all your adds/deletes/checkins/checkouts from the source control explorer instead of the solution explorer. To approach it this way do the following:

                    a) go to the source control web portal and create a new project
                    b) open the source control explorer in VS and set the local path for the new project to your NinjaTrader 8\bin\Custom folder
                    c) from the source control explorer add your files that you want to source control
                    d) use the source control explorer to do all your gets and etc.

                    Comment


                      #11
                      I have been going through iterations of using TFS and Git (hosted on visualstudio.com for free with my MSDN subscription).

                      What I finally ended up with was to use git and only "track" files that are not standard NT files. For example no @*.cs files, no *.resx files, no *.dll files. This is done by setting up the .gitignore file to ignore these files during all git operations. Here is what I added to the installed .gitignore file:

                      ## Ignore Some NinjaTrader Files
                      de/
                      es/
                      ru-RU/
                      zh-Hant/
                      NinjaTrader.Custom.dll
                      Resource.Designer.cs
                      ResourceEnumConverter.cs
                      Resource.resx
                      Resource.de*
                      Resource.es*
                      Resource.ru-RU*
                      Resource.zh*
                      AddOns/@*
                      BarTypes/@*
                      ChartStyles/@*
                      DrawingTools/@*
                      ExportNinjaScript/
                      ImportTypes/@*
                      Indicators/@*
                      MarketAnalyzerColumns/@*
                      OptimizationFitnesses/@*
                      Optimizers/@*
                      PerformanceMetrics/@*
                      ShareServices/@*
                      Strategies/@*
                      SuperDomColumns/@*
                      AssemblyInfo.cs
                      NinjaTrader.Custom.xml
                      NinjaTrader.Vendor.cs
                      NinjaTrader.Vendor.dll

                      IMO, don't bother trying to use VisualStudio to manage the process. Install git and use the Bash shell. Read the first 3 chapters of the Pro Git ebook found here https://progit.org/

                      I believe this will have no issues migrating from version to version; other than any required updates due to "code breaking changes"..

                      FYI. Setup your .gitignore file first before "push"ing your files otherwise all the NT files will go in and then you will have to start removing them from the "cache" using something like :
                      http://www.arlocarreon.com/blog/git/...deleting-them/
                      Last edited by tornadoatc; 12-11-2015, 02:30 PM.

                      Comment


                        #12
                        Gotta say I've been using TFS since NT8 beta was released and it has been working perfectly for me. The key is just making the local path your custom directory with subdirectories for each extension type and using the source explorer instead of the project to add/check in files. I'm sure Git works fine as well.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by pstrusi, Today, 09:06 AM
                        0 responses
                        1 view
                        0 likes
                        Last Post pstrusi
                        by pstrusi
                         
                        Started by vpzdcv, Today, 02:31 AM
                        0 responses
                        8 views
                        0 likes
                        Last Post vpzdcv
                        by vpzdcv
                         
                        Started by YevhenShynkarenko, Today, 01:22 AM
                        0 responses
                        16 views
                        0 likes
                        Last Post YevhenShynkarenko  
                        Started by ttodua, Today, 12:52 AM
                        0 responses
                        7 views
                        0 likes
                        Last Post ttodua
                        by ttodua
                         
                        Started by ttodua, Today, 12:50 AM
                        0 responses
                        6 views
                        0 likes
                        Last Post ttodua
                        by ttodua
                         
                        Working...
                        X