It’s much, much better than it used to be, so let’s all take a moment of silence to appreciate that.Anyway, you’re not going to need the thousands of options that are available to you during the initial installation process. Visual Studio 2019 Community Edition (not to be confused with Visual Studio Code).Microsoft recently overhauled the installation process. We suggest the Community Edition because you won’t need any of the features offered by the pricier (and they can be pricey) tiers. Read our pricing guide for more detailed comparisons between editions. This guide only uses Visual Studio 2019.Download Visual Studio 2019 Community Edition (free). That said, don’t confuse Visual Studio 2019 with Visual Studio Code.Sit back, relax, and wait for the magic. Select what you want but beware the download sizes.Let the installer do its thing. Some of these options can increase the download size by 5+ GB. Feel free to opt in to anything else you think looks interesting but be aware that you will have to download everything.
![]() ![]() Visual Studio Ctrl Period Download Visual StudioIf you selected more installation options in the first steps of this guide, you’ll be absolutely swimming in them.Search for “console” to filter down to just console applications. Initiate new project wizard.There are definitely a lot of project templates to sift through. You can remap them, but really how often are you going to be creating new projects to justify a handy shortcut? Confirm successful repository creation. Yes, there are keyboard shortcuts to do this, but they’re not very convenient. Confirm that the repository now shows in the “Local Git Repositories” section of the Team Explorer.Initiate the Project Creation Wizard by clicking File –> New –> Project. Used properly, extensions have the potential to boost your productivity and development efficiency.Go to top Create Project In New Git RepositoryThe repository is ready to go, but it’s empty. NET Core Console Application.Enter your project name, select the folder location in which you initialized the Git repository from previous steps. Note that there are templates for other languages (VB and F#) that aren’t relevant to this tutorial.Click Next. NET Core SDK was installed with Visual Studio 2019. If you don’t see any changes listed here, go back to the project creation step and make sure that you created the project in the same folder as the Git repository. Files that Git recognizes as new are not tracked by default and require you to explicitly add the files to be tracked. Your solution, project file, and template classes will be created and placed in your repository folders.Visual Studio has a “Team Explorer” docked sidebar (you can drag it to move it around) which enables you to manage your local Git repository and attached remotes.Change the Team Explorer section drop down to “Changes” so that you can view changes on your active branch (which is the master branch at the moment).Even though your project has been added to your local repository folder, you haven’t yet committed those changes. Gitignore file was sourced from the GitHub gitignore repository. Gitignore files based on built in templates.Specifically, the. In this step, Visual Studio’s repository creation wizard has automatically staged. Staged Changes is a list of files that have been added to Git’s staged tracking list to be committed. That is, you haven’t run git add on those files to stage them for a commit. Changes is a list of pending file changes that you haven’t acted on. Double check staged changes prior to commitment.Good commits have good commit messages. Confirm that these are as you expect prior to commitment.If anything looks wrong at this step, you can Unstage by right clicking the file and selecting “Unstage”. Confirm your changes prior to staging.The Team Explorer UI will update with all changes in the Staged Changes section. It’s common for developers to make local changes specifically for debugging or testing purposes without the intention of committing those to the repository.Do yourself and your team a favor by always double checking your changes prior to staging and definitely prior to commitment. In this case, staging everything is fine, but in the real world, you might want to pick and choose exactly which changes to stage. Write a good commit message and commit to the local repository.At this point the project is committed to Git and enshrined in the history forever. Commit Staged and Sync to commit staged changes to the local repository, pull changes from a remote repository, and then push your changes to that remote repositoryWe only care about the first one for this guide because we have no remote repositories setup. Commit Staged and Push to commit staged changes to the local repository and push to a remote repository (like GitHub or Bitbucket) Commit Staged to commit staged changes to the local repository That’s vague, but the point is that you should be descriptive enough for those who will come after you but without requiring the reader to struggle to the end. Quicken for mac specialGreen lines on the right indicate the current state.Always confirm that these changes are exactly as you expect. Use the comparison tool to confirm your changes.The previously chosen option will launch the Visual Studio Diff Viewer, which displays changes between the HEAD (left, unmodified state of your branch) and the current state (right, pending changes that haven’t yet been committed).Red lines on the left indicate the previous state. Long development sessions can leave behind unwanted comments and code that you intended to remove prior to commitment.Right click the file or folder that changed and click “Compare with Unmodified…” to see what changes are pending to be staged or committed. Changes are automatically detected and displayed.Before you commit stage and commit changes, always check to make sure the changes are what you expected. Reduce your risk and keep your coworkers sane by maintaining small and frequent changes.Go to top Create and Commit to a Local BranchAs we previously wrote about in 5 Essential Things Every Programmer Should Know, branching is critical to your success, your team’s success, and ultimately your project’s success.Without the ability to create independent branches of code, team members would be conflicting with each other every time a developer made a commit. Stage, message, commit is a common workflow.We encourage all developers to commit early and commit often. Click “Commit Staged” to commit to the local repository. Enter the commit message (a good one). For new repositories, only master will exist as a branch source.The new branch UI will display in the Team Explorer. Until now, all changes have been committed against that branch.Right click the master branch, click “New Local Branch From…” to begin creating a branch based on the current state of master. View branches using the Branches tab in Team Explorer.The only branch in a new repository is the default branch known as master. bugfix/ prefix indicates that work committed to the branch represents changes for a bug fix. Example: feature/add-new-questions-to-ui. feature/ prefix indicates that work committed to the branch represents changes for a new feature. One common naming convention is found in the Gitflow Workflow. It’s just an option for convenience.Branch naming is a hot topic and can invoke a lot of opinions. release/ prefix indicates a standard release branch which includes tested and ready-to-go features an fixes. Example: hotfix/-fix-broken-login. hotfix/ prefix indicates the branch will have an escalated release path because of critical fixes included on it. Good naming conventions for branches helps productivity. Just make sure the names make sense. Whatever works best for your flow is fine.
0 Comments
Leave a Reply. |
Details
AuthorJohn ArchivesCategories |