Visual Studio Github How to Upload References

Working with GitHub in VS Code

GitHub is a cloud-based service for storing and sharing source code. Using GitHub with Visual Studio Code lets yous share your source code and collaborate with others right within your editor. There are many ways to interact with GitHub, for example, via their website at https://github.com or the Git control-line interface (CLI), but in VS Code, the rich GitHub integration is provided by the GitHub Pull Requests and Issues extension.

Install the GitHub Pull Requests and Bug extension

To get started with the GitHub in VS Code, you'll need to create a GitHub business relationship and install the GitHub Pull Requests and Issues extension. In this topic, we'll demonstrate how you can use some of your favorite parts of GitHub without leaving VS Code.

If yous're new to source control or desire to learn more about VS Code's bones Git support, you lot tin can start with the Version Control topic.

Getting started with GitHub Pull Requests and Issues

Once you've installed the GitHub Pull Requests and Problems extension, you'll need to sign in. Follow the prompts to authenticate with GitHub in the browser and return to VS Code.

Extension Sign In

If you are non redirected to VS Lawmaking, you tin can add your authorization token manually. In the browser window, you lot will receive your dominance token. Copy the token, and switch back to VS Code. Select Signing in to github.com... in the Condition bar, paste the token, and hitting Enter.

Setting upwardly a repository

Cloning a repository

You can search for and clone a repository from GitHub using the Git: Clone command in the Command Palette ( ⇧⌘P (Windows, Linux Ctrl+Shift+P)) or by using the Clone Repository button in the Source Control view (available when you have no folder open).

Clone Repository button in the Source Control view

From the GitHub repository dropdown yous can filter and selection the repository you desire to clone locally.

GitHub repository dropdown filtered on microsoft/vscode

Authenticating with an existing repository

Enabling authentication through GitHub happens when you run whatsoever Git action in VS Code that requires GitHub authentication, such as pushing to a repository that you're a member of or cloning a private repository. You don't need to have whatsoever special extensions installed for hallmark; it is built into VS Code then that you can efficiently manage your repository.

When y'all do something that requires GitHub authentication, you lot'll encounter a prompt to sign in:

Authentication Prompt

Follow the steps to sign into GitHub and return to VS Code. If authenticating with an existing repository doesn't work automatically, y'all may need to manually provide a personal access token. See Personal Admission Token authentication for more information.

Annotation that at that place are several means to authenticate to GitHub, including using your username and password with two-factor authentication (2FA), a personal admission token, or an SSH key. See About authentication to GitHub for more information and details about each selection.

Annotation: If you'd like to work on a repository without cloning the contents to your local machine, you can install the GitHub Repositories extension to browse and edit directly on GitHub. You lot can learn more below in the GitHub Repositories extension section.

Editor integration

Hovers

When you lot have a repository open and a user is @-mentioned, you can hover over that username and run across a GitHub-fashion hover.

User Hover

There is a similar hover for #-mentioned issue numbers, full GitHub outcome URLs, and repository specified problems.

Issue Hover

Suggestions

User suggestions are triggered past the "@" character and issue suggestions are triggered by the "#" graphic symbol. Suggestions are available in the editor and in the Source Control view's input box.

User and Issue suggestions

The issues that appear in the proposition tin can exist configured with the GitHub Issues: Queries (githubIssues.queries) setting. The queries apply the GitHub search syntax.

Yous can also configure which files show these suggestions using the settings GitHub Bug: Ignore Completion Trigger (githubIssues.ignoreCompletionTrigger) and GitHub Issues: Ignore User Completion Trigger (githubIssues.ignoreUserCompletionTrigger). These settings have an assortment of language identifiers to specify the file types.

                      // Languages that the '#' grapheme should not be used to trigger issue completion suggestions.            "githubIssues.ignoreCompletionTrigger"            : [                                    "python"            ]                  

Pull requests

From the Pull Requests view you can view, manage, and create pull requests.

Pull Request View

The queries used to display pull requests tin can exist configured with the GitHub Pull Requests: Queries (githubPullRequests.queries) setting and utilize the GitHub search syntax.

                      "githubPullRequests.queries"            : [                          {                                    "label"            :                        "Assigned To Me"            ,                                    "query"            :                        "is:open up assignee:${user}"                          },                  

Creating Pull Requests

Once y'all have committed changes to your fork or branch, y'all can use the GitHub Pull Requests: Create Pull Request control or the Create Pull Request push button in the Pull Requests view to create a pull request.

Create Pull Request button in the Pull Request view

A new Create Pull Asking view volition exist displayed where you can select the repository and branch you'd similar your pull request to target every bit well every bit fill up in details such as the title, description, and whether it is a draft PR. If your repository has a pull request template, this will automatically be used for the description.

Create Pull Request view

Once you select Create, if y'all have not already pushed your branch to a GitHub remote, the extension will ask if you'd like to publish the branch and provides a dropdown to select the specific remote.

The Create Pull Request view now enters Review Mode, where y'all can review the details of the PR, add comments, reviewers, and labels, and merge the PR once information technology'south ready.

After the PR is merged, you'll have the option to delete both the remote and local branch.

Reviewing

Pull requests can be reviewed from the Pull Requests view. You lot can assign reviewers and labels, add together comments, approve, close, and merge all from the pull request Description.

Pull Request Description editor

From the Description page, you can also easily checkout the pull asking locally using the Checkout push button. This volition switch VS Code to open the fork and branch of the pull request (visible in the Status bar) in Review Mode and add a new Changes in Pull Request view from which y'all can view diffs of the current changes every bit well as all commits and the changes within these commits. Files that have been commented on are decorated with a diamond icon. To view the file on disk, yous can use the Open up File inline action.

Changes in Pull Request view

The diff editors from this view use the local file, and so file navigation, IntelliSense, and editing piece of work equally normal. You can add together comments within the editor on these diffs. Both calculation single comments and creating a whole review is supported.

When you are done reviewing the pull request changes you tin can merge the PR or select Exit Review Manner to go back to the previous co-operative you were working on.

Issues

Creating issues

Issues tin can be created from the + button in the Issues view and by using the GitHub Issues: Create Issue from Selection and GitHub Issues: Create Issue from Clipboard commands. They can besides be created using a Code Action for "TODO" comments. When creating issues, you can accept the default description or select the Edit Description pencil icon in the upper right to bring upwardly an editor for the issue trunk.

Create Issue from TODO

You can configure the trigger for the Code Action using the GitHub Issues: Create Issue Triggers (githubIssues.createIssueTriggers) setting.

The default issue triggers are:

                      "githubIssues.createIssueTriggers"            : [                                    "TODO"            ,                                    "todo"            ,                                    "BUG"            ,                                    "FIXME"            ,                                    "ISSUE"            ,                                    "HACK"            ]                  

Working on issues

From the Issues view, you can see your issues and work on them.

Issue view with hover

By default, when you start working on an event (Outset Working on Issue context carte du jour item), a branch will exist created for you, every bit shown in the Condition bar in the prototype below.

Work on Issue

The Status bar likewise shows the active issue and if yous select that item, a listing of outcome actions are bachelor such every bit opening the outcome on the GitHub website or creating a pull request.

Issue Status bar actions

You tin configure the name of the co-operative using the GitHub Issues: Issue Branch Title (githubIssues.issueBranchTitle) setting. If your workflow doesn't involve creating a branch, or if you want to be prompted to enter a branch name every time, you tin skip that footstep by turning off the GitHub Issues: Employ Branch For Issues (githubIssues.useBranchForIssues) setting.

Once yous are washed working on the issue and desire to commit a alter, the commit bulletin input box in the Source Control view will be populated with a bulletin, which can be configured with GitHub Issues: Working Upshot Format SCM (githubIssues.workingIssueFormatScm).

GitHub Repositories extension

The GitHub Repositories extension lets you quickly browse, search, edit, and commit to whatsoever remote GitHub repository direct from within Visual Studio Code, without needing to clone the repository locally. This can be fast and convenient for many scenarios, where you just need to review source lawmaking or brand a small change to a file or asset.

GitHub Repositories extension

Opening a repository

Once you have installed the GitHub Repositories extension, yous can open a repository with the GitHub Repositories: Open Repository... command from the Command Palette ( ⇧⌘P (Windows, Linux Ctrl+Shift+P)) or by clicking the Remote indicator in the lower left of the Status bar.

Remote indicator in the Status bar

When you run the Open Repository control, y'all then choose whether to open a repository from GitHub, open a Pull Request from GitHub, or reopen a repository that you had previously connected to.

If you oasis't logged into GitHub from VS Lawmaking before, you'll be prompted to authenticate with your GitHub account.

GitHub Repository extension open repository dropdown

Yous can provide the repository URL direct or search GitHub for the repository you want past typing in the text box.

In one case you accept selected a repository or Pull Request, the VS Code window volition reload and you will run across the repository contents in the File Explorer. You tin then open files (with full syntax highlighting and bracket matching), make edits, and commit changes, merely like you would working on a local clone of a repository.

One difference from working with a local repository is that when you commit a change with the GitHub Repository extension, the changes are pushed directly to the remote repository, similar to if you were working in the GitHub web interface.

Another characteristic of the GitHub Repositories extension is that every time y'all open a repository or branch, you get the up-to-date sources bachelor from GitHub. You don't demand to remember to pull to refresh as you would with a local repository.

Switching branches

Y'all can hands switch between branches by clicking on the branch indicator in the Status bar. One great feature of the GitHub Repositories extension is that you can switch branches without needing to stash uncommitted changes. The extension remembers your changes and reapplies them when you switch branches.

Branch indicator on the Status bar

Remote Explorer

You lot can apace reopen remote repositories with the Remote Explorer available on the Activity bar. This view shows you the previously opened repositories and branches.

Remote Explorer view

Create Pull Requests

If your workflow uses Pull Requests, rather than direct commits to a repository, you can create a new PR from the Source Control view. You lot'll be prompted to provide a title and create a new branch.

Create a Pull Request button in the Source Control view

Once you take created a Pull Request, you can use the GitHub Pull Request and Issues extension to review, edit, and merge your PR as described earlier in this topic.

Virtual file system

Without a repository's files on your local machine, the GitHub Repositories extension creates a virtual file system in memory and so yous can view file contents and make edits. Using a virtual file system means that some operations and extensions which presume local files are not enabled or have limited functionality. Features such every bit tasks, debugging, and integrated terminals are not enabled and you tin learn about the level of support for the virtual file system via the features are not bachelor link in the Remote indicator hover.

Remote indicator hover with features are not available link

Extension authors can acquire more well-nigh running in a virtual file system and workspace in the Virtual Workspaces extension writer's guide.

Continue Working on...

Sometimes you'll want to switch to working on a repository in a development environment with support for a local file system and full language and development tooling. The GitHub Repositories extension makes it like shooting fish in a barrel for you to clone the repository locally or into a Docker container (if you have Docker and the Microsoft Docker extension installed) with the GitHub Repositories: Continue Working on... command bachelor from the Control Palette ( ⇧⌘P (Windows, Linux Ctrl+Shift+P)) or by clicking on the Remote indicator in the Status bar.

Continue Working on command in Remote dropdown

If you are using the browser-based editor, the "Keep Working On..." command has the options to open the repository locally or within a cloud-hosted environment in GitHub Codespaces.

Continue Working On from web-based editor

sharphadd1995.blogspot.com

Source: https://code.visualstudio.com/docs/editor/github

0 Response to "Visual Studio Github How to Upload References"

Postar um comentário

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel