1. Download and install git and add the path to the environment variable. Enter
git --version
. If the version number is displayed, the installation is successful.
2. Create a new warehouse on github. For example: myrepo
3. Create a new folder locally as the working folder of the VSCode code. For example: mycode
4, mycode is both the code working folder of VSCode and the local Git repository. Enter mycode in command line mode. Enter git init
git init
5 and add your username and email address. The username and email address are the ones used when registering GitHub:
git config --global user.name "myname" git config --global user.email "myname@mymail.com"
6. Generate a key. Continue to enter in this directory:
ssh-keygen -t rsa -C "myname@mymail.com"
After the command is executed, a file named id_rsa.pub will be generated. Open the file with a text editor and copy the full text.
7. Open the myrepo warehouse on github. Enter settings, set deployment keys, and paste the contents of id_rsa.pub into it. By default, the title corresponding to this key is myname@mymail.com.
8. Bind the local folder and the github repository
git remote add mycode git@github.com:myname/myrepo.git
9. After the setting is completed, perform a connection test
ssh -T git@github.com
10. First pull in sequence, and then proceed Push in turn.
git pull mycode master
git push --force mycode master
11. After the above configuration is completed, you can use VSCode to open the mycode folder to perform related operations. At this time, for any changes that occur in the folder, the number of the corresponding changed file will appear on the "Source Code Management" icon of VSCode. After clicking the "Source Code Management" picture, all changed file names will be listed. Click... in the upper right corner to perform the "Submit" operation.
12. After the submission is completed, check the GitHub myrepo for corresponding changes. If there is no change, open the console (ctrl `) in VSCode and select "Output" to see if there are relevant error prompts and make adjustments according to the error prompt information.
Recommended tutorial: vscode tutorial
The above is the detailed content of How to use github in vscode. For more information, please follow other related articles on the PHP Chinese website!

Yes, some versions of VisualStudio are free. Specifically, VisualStudioCommunityEdition is free for individual developers, open source projects, academic research, and small organizations. However, there are also paid versions such as VisualStudioProfessional and Enterprise, suitable for large teams and enterprises, providing additional features.

Cross-platform development with VisualStudio is feasible, and by supporting frameworks like .NETCore and Xamarin, developers can write code at once and run on multiple operating systems. 1) Create .NETCore projects and use their cross-platform capabilities, 2) Use Xamarin for mobile application development, 3) Use asynchronous programming and code reuse to optimize performance to ensure efficient operation and maintainability of applications.

The ways to format JSON in VS Code are: 1. Use shortcut keys (Windows/Linux: Ctrl Shift I; macOS: Cmd Shift I); 2. Go through the menu ("Edit" > "Format Document"); 3. Install JSON formatter extensions (such as Prettier); 4. Format manually (use shortcut keys to indent/extract blocks or add braces and semicolons); 5. Use external tools (such as JSONLint and JSON Formatter).

Compiling code in VSCode is divided into 5 steps: Install the C extension; create the "main.cpp" file in the project folder; configure the compiler (such as MinGW); compile the code with the shortcut key ("Ctrl Shift B") or the "Build" button; run the compiled program with the shortcut key ("F5") or the "Run" button.

To install Visual Studio Code, please follow the following steps: Visit the official website https://code.visualstudio.com/; download the installer according to the operating system; run the installer; accept the license agreement and select the installation path; VSCode will start automatically after the installation is completed.

The methods to enlarge fonts in Visual Studio Code are: open the settings panel (Ctrl, or Cmd,). Search and adjust "Font Size". Choose "Font Family" with the right size. Install or select a theme that provides the right size. Use keyboard shortcuts (Ctrl or Cmd) to enlarge the font.

How to connect to a remote server through VSCode? Install Remote - SSH Extended Configuration SSH Create a Connection in VSCode Enter connection information: Host, Username, Port, SSH Key Double-click the saved connection in Remote Explorer

Running a Vue project in VSCode requires the following steps: 1. Install the Vue CLI; 2. Create a Vue project; 3. Switch to the project directory; 4. Install project dependencies; 5. Run the development server; 6. Open the browser to visit http://localhost:8080.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.