Close Menu
SalesforceCodex
    Facebook X (Twitter) Instagram
    Trending
    • How to Build a Generic Modal Window in Lightning Web Component
    • Top 10 Salesforce Flow Features of Salesforce Summer ’25
    • Unlock the Power of Vibe Coding in Salesforce
    • How to Implement Dynamic Queueable Chaining in Salesforce Apex
    • How to Implement Basic Queueable Chaining in Salesforce Apex
    • How to Suppress PMD Warnings in Salesforce Apex
    • Top 10 PMD Issues Salesforce Developers Should Focus on in Apex
    • How to Use Graph API for Outlook-Salesforce Connection
    Facebook X (Twitter) Instagram
    SalesforceCodex
    Subscribe
    Thursday, May 29
    • Home
    • Architecture
    • Salesforce
      • News
      • Apex
      • Integration
      • Books Testimonial
    • Questions
    • Certification
      • How to Prepare for Salesforce Integration Architect Exam
      • Certification Coupons
    • Integration Posts
    • Downloads
    • About Us
      • Privacy Policy
    SalesforceCodex
    Home»Salesforce»Visual Studio Code and Code Versioning in TFS

    Visual Studio Code and Code Versioning in TFS

    Dhanik Lal SahniBy Dhanik Lal SahniOctober 17, 2018Updated:October 17, 2018No Comments4 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr Email
    Visual Studio Code and Code Versioning in TFS
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Version control is a framework that records changes to a document or set of documents after some time with the goal that you can review particular forms later. For the models in this blog, you will utilize programming source code as the documents being version controlled; however as a general rule you can do this with about a record on a PC.

    Below are version control types

    Local Version Control Systems:
    Many people’s version-control method of choice is to copy files into another directory. This approach is very common because it is so simple, but it is also incredibly error prone. It is easy to forget which directory you’re in and accidentally write to the wrong file or copy over files you don’t mean to.

    Centralized Version Control Systems
    In Centralized system, all files and historical data are stored on a central server. And developers commit their changes directly to that central server repository.

    Distributed Version Control Systems
    In a DVCS clients don’t just check out the latest snapshot of the files; rather, they fully mirror the repository, including its full history. Thus, if any server dies, and these systems were collaborating via that server, any of the client repositories can be copied back up to the server to restore it. Every clone is really a full backup of all the data.

    We will use Visual Studio Code, Git for Window and TFS for this blog. Please install Visual Studio Code and Git.

    Just for information, Visual Studio Code is new IDE for salesforce development. You can check another blog for working in this IDE for salesforce development.

    Let us integrate TFS (Team Foundation Server) with Visual Studio Code and Salesforce for code versioning and management. For code version and salesforce development below are steps.
    1. Code Cloning
    2. Development Changes
    3. Commit changes
    4. Pull Request

    Let us do every step one by one.
    1. Code Cloning
    Code clones are separate fragments of code that are very similar to master copy. Cloning is done so that we will get complete code and it will not impact running applications code.

    Let us see we have TFSDemoApp project, which is created in TFS. You can get this in TFS Code section.

    If we want to get clone of that application, click to get highlighted section, it will show below popup to get remote url for cloning. Click copy icon to copy remote url.

    Let us create a clone in local system. We need one folder where code will be copied. So create folder where you need to clone. After folder creation, right click on folder, this will open some menus with Git commands like below.

    Select Git Clone from menu. It will show another popup where you have to put remote url which is copied from TFS.

    You can specify branch also while taking clone. This will get complete copy of code in your local directory.

    2. Development Changes
    Once code is cloned, open that code in Visual Studio Code IDE. This will be look like this. Do your changes in code.

    As soon as code is change, it will show in upstaged list. See highlighted icon and object name.

    Move those objects into staged list so that it can commit to TFS. This can be done by right clicking objects and selecting Stage Changes.

    See highlighted area, one section STAGED CHANGES is created and selected objects moved to list.

    3. Commit changes
    Let us move these changes to TFS so that it will be used by other developer as well. Click on highlighted icon to commit your changes.

    It will ask comment to make an entry in code versioning. Put proper comment, what is reason for changing object. You can put bug # also here.

    Once commit is completed, code is committed in your local branch. We have to move that in TFS also so use command git push on terminal (View->Terminal).

    4. Pull Request
    Once code is committed to TFS, We can create pull request. Pull request is to merge your changes in originating branch. This request is done by developer and normally leads or code reviewer will approve/reject request.

    Once code is approved, code will be merged in originating branch.

    Summary:

    Code versioning is very important for any project to team collaboration, audit controls and backup. If any project does not have code management then that will be very prone to code failure.

    Code versioning for Salesforce Project tfs Visual Studio Code
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleSalesforce Development in Visual Studio Code
    Next Article Android developers has to use API level 26 from today
    Dhanik Lal Sahni
    • Website

    Related Posts

    By Dhanik Lal Sahni4 Mins Read

    How to Build a Generic Modal Window in Lightning Web Component

    May 26, 2025
    By Dhanik Lal Sahni6 Mins Read

    Top 10 Salesforce Flow Features of Salesforce Summer ’25

    May 11, 2025
    By Dhanik Lal Sahni6 Mins Read

    Unlock the Power of Vibe Coding in Salesforce

    April 30, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Ranked #1 SALESFORCE DEVELOPER BLOG BY SALESFORCEBEN.COM
    Featured on Top Salesforce Developer Blog By ApexHours
    Recent Posts
    • How to Build a Generic Modal Window in Lightning Web Component
    • Top 10 Salesforce Flow Features of Salesforce Summer ’25
    • Unlock the Power of Vibe Coding in Salesforce
    • How to Implement Dynamic Queueable Chaining in Salesforce Apex
    • How to Implement Basic Queueable Chaining in Salesforce Apex
    Ranked in Top Salesforce Blog by feedspot.com
    RSS Recent Stories
    • How to Connect Excel to Salesforce to Manage Your Data and Metadata February 9, 2025
    • Difference Between With Security and Without Security in Apex January 2, 2025
    • Top Reasons to Love Salesforce Trailhead: A Comprehensive Guide December 5, 2024
    • How to Utilize Apex Properties in Salesforce November 3, 2024
    • How to Choose Between SOQL and SOSL Queries July 31, 2024
    Archives
    Categories
    Tags
    apex (111) apex code best practice (8) apex rest (11) apex trigger best practices (4) architecture (22) Asynchronous apex (9) AWS (5) batch apex (9) batch processing (4) code optimization (8) code review tools (3) custom metadata types (5) design principle (9) file upload (3) flow (15) future method (4) google (6) google api (4) integration (19) integration architecture (6) lighting (8) lightning (64) lightning-combobox (5) lightning-datatable (10) lightning component (30) Lightning web component (62) lwc (51) named credential (8) news (4) optimize apex code (4) Permission set (4) pmd (3) Queueable (9) rest api (23) S3 Server (4) salesforce (141) salesforce apex (46) salesforce api (4) salesforce api integration (5) Salesforce Interview Question (4) salesforce news (5) salesforce question (5) solid (6) tooling api (5) Winter 20 (8)

    Get our newsletter

    Want the latest from our blog straight to your inbox? Chucks us your detail and get mail when new post is published.
    * indicates required

    Ranked #1 SALESFORCE DEVELOPER BLOG BY SALESFORCEBEN.COM
    Featured on Top Salesforce Developer Blog By ApexHours
    Recent Posts
    • How to Build a Generic Modal Window in Lightning Web Component
    • Top 10 Salesforce Flow Features of Salesforce Summer ’25
    • Unlock the Power of Vibe Coding in Salesforce
    • How to Implement Dynamic Queueable Chaining in Salesforce Apex
    • How to Implement Basic Queueable Chaining in Salesforce Apex
    Ranked in Top Salesforce Blog by feedspot.com
    RSS Recent Stories
    • How to Connect Excel to Salesforce to Manage Your Data and Metadata February 9, 2025
    • Difference Between With Security and Without Security in Apex January 2, 2025
    • Top Reasons to Love Salesforce Trailhead: A Comprehensive Guide December 5, 2024
    • How to Utilize Apex Properties in Salesforce November 3, 2024
    • How to Choose Between SOQL and SOSL Queries July 31, 2024
    Archives
    Categories
    Tags
    apex (111) apex code best practice (8) apex rest (11) apex trigger best practices (4) architecture (22) Asynchronous apex (9) AWS (5) batch apex (9) batch processing (4) code optimization (8) code review tools (3) custom metadata types (5) design principle (9) file upload (3) flow (15) future method (4) google (6) google api (4) integration (19) integration architecture (6) lighting (8) lightning (64) lightning-combobox (5) lightning-datatable (10) lightning component (30) Lightning web component (62) lwc (51) named credential (8) news (4) optimize apex code (4) Permission set (4) pmd (3) Queueable (9) rest api (23) S3 Server (4) salesforce (141) salesforce apex (46) salesforce api (4) salesforce api integration (5) Salesforce Interview Question (4) salesforce news (5) salesforce question (5) solid (6) tooling api (5) Winter 20 (8)

    Get our newsletter

    Want the latest from our blog straight to your inbox? Chucks us your detail and get mail when new post is published.
    * indicates required

    Facebook X (Twitter) Instagram Pinterest YouTube Tumblr LinkedIn Reddit Telegram
    © 2025 SalesforceCodex.com. Designed by Vagmine Cloud Solution.

    Type above and press Enter to search. Press Esc to cancel.

    Ad Blocker Enabled!
    Ad Blocker Enabled!
    Our website is made possible by displaying online advertisements to our visitors. Please support us by disabling your Ad Blocker.