心肾不交吃什么药| 尿道感染是什么原因| 静脉曲张不治疗会有什么后果| 舌头溃疡吃什么药最好| 藤茶是什么茶| 属猪的和什么属相最配| 特殊门诊是什么意思| 肺结节是什么原因| 喝牛奶不能和什么一起吃| 用什么泡脚可以去湿气| 血小板过低有什么危害| 日十组成什么字| 梦见车丢了是什么意思| 胃酸是什么酸| 口干口臭什么原因引起的| 南昌有什么好玩的景点| 印泥用什么能洗掉| 胃火旺吃什么中成药| 重阳节为什么要插茱萸| 完全性右束支传导阻滞是什么意思| 为什么出汗有酸臭味| 肌肉疼痛吃什么药| 炖鸡汤放什么材料好吃| 为什么抽烟会上瘾| 支教回来后有什么待遇| 膝关节置换后最怕什么| 减肥中午吃什么比较好| 甘草有什么功效| 脸发烫是什么原因| 什么是正太| 夏季摆摊卖什么好| 一国两制什么时候提出的| 看见双彩虹有什么征兆| 美味佳肴是什么意思| 幽门螺杆菌感染有什么症状| 心代表什么数字| 为什么晚上不能剪指甲| 重阳节是什么生肖| 左手中指麻木是什么原因| 人乳头瘤病毒33型阳性是什么意思| 买手是什么职业| 鱼和什么不能一起吃| 三个金念什么| 印度人为什么用手抓饭吃| 做核磁共振挂什么科| 什么是牙冠| 什么东西越洗越脏| 子宫出血是什么原因| 国资委什么级别| 喝葡萄汁有什么好处| 被蚂蚁咬了怎么止痒消肿要擦什么药| 血清是什么意思| 孕妇吃什么鱼最好| 有机是什么意思| 老烂腿抹什么药膏最好| 龙须菜是什么菜| 追求是什么意思| 出生医学证明有什么用| 邓紫棋属什么生肖| 脂肪瘤挂什么科| luxury是什么牌子| 爱马仕为什么要配货| 关税什么意思| mandy英文名什么意思| 皮肤溃烂是什么病| 牙签肉是什么肉| 脖子上有痣代表什么| 嫦娥是什么生肖| 素金是什么意思| 德巴金是什么药| ebay是什么| 肝功能谷丙转氨酶偏高是什么原因| 强直性脊柱炎是什么| 属猪的跟什么属相最配| 目赤是什么意思| 紫薇花什么季节开花| 杏仁是什么| 杞人忧天是什么意思| 脸部肌肉跳动是什么原因| 烈女怕缠郎是什么意思| 髋关节在什么位置| 切片是什么意思| 6月16号是什么星座| 晚上搬家有什么说法| 呋喃硫胺片治什么病| it代表什么| 苹果醋什么时候喝最好| 路旁土命什么意思| 女人眼睛干涩吃什么药| 大泽土是什么生肖| 孕晚期吃什么水果好| 乳腺癌多发于什么年龄| 白鳍豚用什么呼吸| 李子吃了有什么好处| 什么叫阴虱| HlV是什么| zoom是什么意思| 见利忘义是什么意思| 人体最长的骨头是什么| 前白蛋白是什么意思| 1931年属什么生肖| 病理性骨折是什么意思| 有恙是什么意思| 驴血为什么是白色的| 宝格丽表属于什么档次| 五指毛桃根有什么功效| 40不惑是什么意思| 一只脚心疼是什么原因| 吐露是什么意思| 北京西单附近有什么好玩的| 霸王硬上弓什么意思| 肾综合征是什么病严重吗| 男人眉心有痣代表什么| 一什么凳子| 考上公务员意味着什么| 慢性鼻窦炎吃什么药| 做提肛运动有什么好处| 肝癌是什么症状| 利可君片是治什么病| 12朵玫瑰代表什么意思| 芒果不可以跟什么一起吃| rp是什么意思| 坎坷人生是什么生肖| 内科是看什么病的| 什么是远视| 人参有什么功效| 早上9点到10点是什么时辰| 哗众取宠是什么意思| 太阳指什么生肖| 腰疼是什么原因| 什么什么直跳| 本字五行属什么| 霜和乳有什么区别| 脑供血不足吃什么好| 市斤是什么意思| 什么叫留守儿童| ct检查是什么意思| 乙肝小三阳是什么意思| 马牙是什么原因引起的| 反复高烧是什么原因| 梦中的梦中是什么歌| 放屁多是什么原因呢| 湿毒是什么原因引起的| 主播是什么意思| 白舌苔很厚是什么病症| 肝肾挂什么科| 睡眠障碍应该挂什么科室| 六八年属什么生肖| 蜗牛的触角有什么作用| 一什么花生| 过去的日子叫什么日| 超声介入是什么意思| 小便短赤吃什么药| 老花眼是什么原因引起的| 兑卦代表什么| 曷是什么意思| 为什么风团会在晚上爆发| 宫颈口大是什么原因| 什么叫御姐| 肚子经常疼是什么原因| 绝经前有什么症状| 武汉都有什么区| 女人的胸部长什么样| 五更是什么时辰| 女性胃火旺吃什么药| 乳头疼吃什么药| 备孕需要做些什么准备| 兰花什么时候开花| 甲钴胺片有什么副作用| 化学阉割什么意思| 他是什么意思| 减肥晚上适合吃什么水果| 外阴裂口什么原因| 喉咙有异物感吃什么药| 50而知天命什么意思| 肌酐高是什么意思| 程门立雪是什么意思| 75c是什么罩杯| 近视散光是什么意思| 7月8号是什么星座| yq是什么意思| cl是什么单位| 柠檬苦是什么原因| 维生素e是什么| 398是什么意思| 腰间盘膨出和突出有什么区别| 脑洞是什么意思| 痴男怨女是什么意思| 黄曲霉素是什么| 合加龙是什么字| 胃疼看病挂什么科| 白果治什么病| joy是什么意思| 海军蓝是什么颜色| 医院为什么不推荐腹膜透析| 什么鲜花填动词| 真菌性龟头炎用什么药| 包皮挂什么科| 咽喉老有痰是什么原因| 豆浆什么人不能喝| 梦见尸体是什么意思| 十面埋伏是什么生肖| 排长是什么军衔| 杭字五行属什么| 男人跑马是什么意思| 花苞裤不适合什么人穿| 红鸾是什么意思| 台风什么时候来| 高血压挂什么科室| 吃虫草有什么好处| 咽喉炎吃什么药有效| 奇脉见于什么病| 清肺火肺热吃什么药最有效| 胼胝体是什么意思| 为什么白带是黄绿色的| 什么是鼻息肉| five是什么意思| 掉头发是缺什么维生素| 葫芦是什么意思| 什么的脚| 大黄是什么| 甲基化是什么意思| 为什么体重一直下降| 火箭是干什么用的| 血管瘤是什么病严重吗| 腕管综合征吃什么药| 亚麻籽有什么功效| neu是什么意思| 梨状肌综合症吃什么药| 1971年属猪的是什么命| 什么是双向情感障碍| 一个虫一个夫念什么| 有什么蔬菜| 为什么会有| prep是什么药| 朗姆酒是什么酒| 什么万千| 显著是什么意思| 田七是什么| 中字五行属什么| 吃什么白细胞升的最快| 胆囊炎能吃什么水果| 黄瓜为什么是绿色的| 高血压吃什么好| 中国最大的岛屿是什么| 硬下疳是什么| 四月二十五是什么星座| 晕车药吃多了有什么副作用| 渚是什么意思| 丁是什么意思| 准生证是什么| 老子和孔子是什么关系| 腿困是什么原因| 1.18是什么星座| 真菌性龟头炎用什么药| 什么是天葬| 金鱼吊兰什么时候开花| 什么人不能吃茄子| 山楂可以和什么一起泡水喝| 做梦烧纸钱什么意思| 检查甲状腺挂什么科| rsa胎位是什么意思| 王晶为什么不娶邱淑贞| 哮喘用什么药| 百度

Try to extend agent mode in VS Code!

杨幂从来不参加别人婚礼,但是她的婚礼一定会现身!

百度 伊丽莎白.泰勒是多切斯特的拥趸,住在多切斯特伦敦顶层的Harlequin套房期间,接拍了破纪录、片酬达数百万英镑的《埃及艳后》,她量身打造的粉红大理石铺的浴室至今沿用。

Want to easily manage your source code and collaborate with others? Git and GitHub are the tools you need! And with Visual Studio Code, you can set up and use them in a snap. Even if you're a beginner, VS Code's user-friendly interface guides you through common Git actions like pushing and pulling code, creating and merging branches, and committing code changes. And if you're a pro, you'll love the ability to perform Git actions directly within the editor, saving you time and effort compared to using the Git command line. Plus, the seamless workflow between VS Code and Git means you can stay in your editor and get more done.

With GitHub Copilot in VS Code, you can get suggestions for commit messages, pull requests, and review code changes before committing them. Learn more about GitHub Copilot in VS Code.

Tip

If you don't have a Copilot subscription yet, use Copilot for free by signing up for the Copilot Free plan. You'll get a monthly limit of completions and chat interactions.

Set up Git in VS Code

To use Git and GitHub in VS Code, first make sure you have Git installed on your computer. If Git is missing, the Source Control view shows instructions on how to install it. Make sure to restart VS Code afterwards.

Additionally you can sign into VS Code with your GitHub account in the Accounts menu in the lower right of the Activity bar to enable additional features like Settings Sync, but also cloning and publishing repositories from GitHub.

Screenshot of the Accounts menu in VS Code

Open a Git repository

VS Code provides several ways to get started in a Git repository, from local to remote cloud-powered environments like GitHub Codespaces.

Clone a repository locally

To clone a repository, run the Git: Clone command in the Command Palette (??P (Windows, Linux Ctrl+Shift+P)), or select the Clone Repository button in the Source Control view.

If you clone from GitHub, VS Code prompts you to authenticate with GitHub. Then, select a repository from the list to clone to your machine. The list contains both public and private repositories.

Screenshot of the Clone Repository quick prompt, searching for repositories with the name vscode

For other Git providers, enter the repository URL, select Clone, and pick a folder on your local machine to clone the files into. VS Code opens the folder once the repository is cloned on your local machine.

Screenshot of the Clone Repository quick prompt, searching for a repository by providing the repository URL

Initialize a repository in a local folder

To initialize a new local Git repository:

  1. Pick an existing or new folder on your computer and open it in VS Code.

  2. In the Source Control view, select the Initialize Repository button.

    This creates a new Git repository in the current folder, allowing you to start tracking code changes.

    This action is equivalent to running git init on the command-line.

    Source Control view for a workspace not under Git source control will offer to Initialize a Git repo or Publish to GitHub

Publish local repository to GitHub

You can also initialize a local repository and publish it directly to GitHub. This creates a new repository on your GitHub account, and pushes your local code changes to the remote repository. Having your source code on a remote repository is a great way to back up your code, collaborate with others, and automate your workflow with GitHub Actions.

Use the Publish to GitHub command button in the Source Control view. You can then choose a name and description for the repository, and whether to make it public or private.

Screenshot of the Publish to GitHub quick prompt, showing private and public GitHub repository names

Once the repository has been created, VS Code pushes your local code to the remote repository. Your code is now backed up on GitHub, and you can start collaborating with others with commits and pull requests.

Open a GitHub repository in a codespace

GitHub Codespaces lets you open a GitHub repository in a fully configured cloud-based development environment, enabling you to develop in a browser without having to install any software on your local computer. GitHub Codespaces allows free usage for individuals, which makes it easy to get started working on open source projects.

To create a codespace for your GitHub repository:

  1. Install the GitHub Codespaces extension in VS Code and sign in with your GitHub account.

  2. Run the Codespaces: Create New Codespace command.

  3. Select the repository and branch you want to open.

    VS Code opens a new window, which is connected to the codespace. The source code, terminal, and running and debugging are hosted in the remote cloud-based development environment.

    Notice that the File Explorer and Status Bar indicate that the workspace is opened in a codespace.

    Screenshot of a workspace opened in a codespace, highlighting the codespace name in the File Explorer and Status Bar

Alternatively, you can also start from a codespace template on the GitHub Codespaces website.

If you already have a codespace open in your browser, run the Codespaces: Open in VS Code Desktop command in the browser to connect to the codespace from your local VS Code Desktop.

You can learn more about GitHub Codespaces, including customization such as forwarding ports, in the Developing in a codespace documentation.

Open a GitHub repository remotely

VS Code's remote repository support allows you to browse and edit a GitHub repository without cloning it to your local computer. This is useful for quickly making changes to a remote repository without having to clone the entire codebase to your machine.

  1. First install the GitHub Repositories extension.

  2. Run the command Remote Repositories: Open Remote Repository... or use the Open Remote Repository button the Explorer view.

  3. Search and select the GitHub repository that you want to open.

    Remote Repositories opening a remote GitHub repo, pull request or Azure repo

Tip

If you need to execute code or run terminal commands, you can seamlessly switch from a remote repository to a codespace with the command Continue Working on.

Staging and committing code changes

Once you have a Git repository set up, you can start tracking code changes by staging and committing your newly created and edited code.

Tip

Commit your changes early and often. This makes it easier to revert back to previous versions of your code if needed.

You can access the Source Control view from the Activity Bar to list all changed files in your workspace. You can toggle between a tree view or list view by using the tree/list icon in the Source Control view header.

Source Control view, highlighting the tree/list view control in the header

When you select a file in the Source Control view, the editor shows a diff view that highlights the file changes, compared to the previously committed file.

Source Control view with one file staged and other changes, a diff showing in the editor that highlights the changes

To stage a file, select the + (plus) icon next to the file in the Source Control view. This adds the file to the Staged Changes section, indicating that it will be included in the next commit.

Source Control view with four changed files, highlighting the '+' button to stage the changes of a file

You can also stage all pending changes at once by selecting the + (plus) icon next to Changes in the Source Control view.

Staged changes can also be discarded by selecting the ? (minus) icon next to the file. Similarly, you can discard all staged changes by selecting the ? (minus) icon next to Staged Changes in the Source Control view.

Source Control view with four changed files, highlighting the '-' button to unstage the changes of a file

To commit your staged changes, type a commit message in the upper text box, and then select the Commit button. This saves your changes to the local Git repository, allowing you to revert to previous versions of your code if needed.

Tip

With GitHub Copilot in VS Code, you can generate a commit message based on your code changes. Learn more about generating commit messages with AI. Before you commit your changes, you can also let Copilot do a code review of the uncommitted changes.

You can navigate through and review all local file changes and commits in the Timeline view available in the bottom of the Explorer view.

Timeline view with one item selected and its change being shown in the editor

Pushing and pulling remote changes

Once you have made commits to your local Git repository, you can push them to the remote repository. The Sync Changes button indicates how many commits are going to be pushed and pulled. Selecting the Sync Changes button downloads (pull) any new remote commits and uploads (push) new local commits to the remote repository.

Sync button with one change to push

Tip

You can enable the Git: Autofetch setting to always get an up-to-date remote commit indicator.

Push and pull can also be performed individually by using their respective commands. You can access these commands from the Source Control menu.

Source Control menu that shows all source control commands

Using branches

In Git, branches allow you to work on multiple versions of your codebase simultaneously. This is useful for experimenting with new features or making large code changes without affecting the main codebase.

The branch indicator in the Status bar shows the current branch and lets you switch to new and existing branches.

Branch indicator in the Status bar

To create a new branch, select the branch indicator and choose to create it from the current branch or another local one. Type a name for the new branch, and confirm. VS Code creates a new branch and switches to it, allowing you to make changes to your code without affecting the main branch.

Create branch quick prompt that shows when selecting the branch indicator

Tip

If you use the GitHub Pull Requests and Issues extension, you can create a branch directly from an issue, which gets you started working in a new local branch and automatically prefills the pull request for you.

After you create a local branch, you can push the branch to the remote repository by selecting Publish Branch in the Source Control view. This creates a new branch on the remote repository, allowing you to collaborate with others in that branch.

Creating and reviewing GitHub pull requests

In Git and GitHub, pull requests (PRs) are a way for collaborators to review and merge code changes from separate branches into the main branch. This enables teams to review and approve code changes before they are incorporated into the main codebase, ensuring that only high-quality changes are merged.

To use pull requests in VS Code, you need to install the GitHub Pull Requests and Issues extension. This extension adds PR and issue tracking functionality to VS Code, allowing you to create, review, and merge PRs from within the editor.

To create a PR, make sure you are on a separate branch from the main branch, and push your code changes to the remote repository. In the Source Control view, select the Create Pull Request button. This opens the PR creation form, where you can enter a title and description for the PR, and choose which branch to merge the changes into. Select Create to create the PR.

Source Control view, highlighting the 'Create pull request' button

Tip

Use GitHub Copilot to generate a PR title and description, based on the commits that are included in the PR. Select the sparkle icon next to the PR title field to generate a PR title and description. You can also let Copilot perform a code review of the PR before you create it. Select the Copilot Code Review button in the GitHub Pull Request view.

Learn more about pull requests in VS Code's GitHub documentation.

Using Git in the built-in terminal

As all Git state is kept in the local repository, you can easily switch between VS Code's UI, the built-in terminal, or external tools like GitHub Desktop. You can also set up VS Code as your default Git editor, allowing you to use VS Code to edit commit messages and other Git-related files.

Git Bash on Windows

Git Bash is a popular shell environment for Windows that provides a Unix-like command-line interface for working with Git and other command-line tools. Visual Studio Code's integrated terminal supports Git Bash as a shell, allowing you to seamlessly integrate Git Bash into your development workflow. Installing Git on your Windows machine also installs Git Bash, if it wasn't deselected during the installation steps.

Selecting Git Bash as shell in Visual Studio Code's built-in terminal

Start by opening View > Terminal (?` (Windows, Linux Ctrl+`)). Select the dropdown arrow next to the + icon in the terminal panel to pick a new shell to open. If Git Bash is installed, it's shown in the list of terminals and shells. You can toggle between different terminals and shells in the Terminal sidebar. With Git Bash configured in Visual Studio Code, you can now use all of your favorite Git commands directly from the terminal in your code editor.

If you want to set Git Bash as your default shell, open the Terminal dropdown (next to the + icon) and select Select Default Profile. This opens a list of available shells, including Git Bash. Selecting Git Bash sets it as your default shell, and all future terminals will be opened with Git Bash. More advanced terminal tips are available in the terminal documentation.

老枞是什么茶 什么牌子的氨基酸洗面奶好 调经吃什么药效果最好 94年是什么年 血糖高不能吃什么食物
甲减要多吃什么食物好 二次报销需要什么条件 脾肾阳虚吃什么药 眉毛变白是什么原因 肺结核咳血是什么程度
marlboro是什么烟 秦国是现在的什么地方 奢侈的近义词是什么 头发一把一把的掉是什么原因 se是什么意思
咖啡和什么不能一起吃 捡到狗狗代表什么预兆 七手八脚是什么意思 kawasaki是什么牌子 八面玲珑什么生肖
属兔带什么招财hcv9jop4ns0r.cn 戴银饰变黑是什么原因bysq.com 陶渊明是什么朝代hcv8jop0ns7r.cn 什么的鞋子hcv8jop8ns3r.cn 百香果和什么搭配好喝hcv9jop7ns5r.cn
脑梗原因是什么引起的hcv8jop6ns9r.cn 石膏是什么hcv9jop4ns8r.cn 盎司是什么意思hcv9jop6ns6r.cn 藤壶是什么hcv8jop9ns8r.cn 酒后头疼吃什么药wzqsfys.com
肠道门诊看什么病hcv7jop6ns3r.cn 家门是什么意思weuuu.com 下午5点多是什么时辰hcv9jop1ns1r.cn 什么品种的芒果最好吃hcv8jop5ns9r.cn 上海为什么叫申城zsyouku.com
下寒上热体质吃什么中成药hcv8jop6ns7r.cn 甲状腺tsh高说明什么tiangongnft.com nb是什么牌子hcv8jop8ns6r.cn 什么网站可以看三节片hcv9jop7ns2r.cn 猫吐了吃什么药hcv8jop4ns0r.cn
百度