GitHub VS Committing Code

When using GitHub, the VS Code Commit setting allows you to conveniently version control your source code, including Git. You can clone a remote repository to a local repository without running Git commands directly from the terminal, and create new commits in the local repository, which can then be pushed back to the remote repository.

In this post, we'll show you how to do just that. If you've ever used the Installing Git and Join GitHubis not set to Install Git and Build Your Own Free Website Part 4 - Deployment (feat. Netlify) Check out the post to learn more.

* If the pictures are too small to see, you can click on them to enlarge them.

1. Create a GitHub remote repository 

[ 신규 원격 저장소 생성 ]
[ Create new remote repository ].

Sign in to GitHub you'll see a Dashboard Click the ① '+' mark on the included line. ② You can start creating a new remote repository (new repository). ③ Create a suitable repository name, then ④ click create repository to complete the repository creation. The following webpage will then show you an address that starts with https. ⑤ Click the clipboard icon to copy the address.

2. Clone to the remote storage region store (Clone)

지역 저장소로 복제
[Replicate to Local Storage ]

Run VS Code and click File-New Window to open a new working window. Step 1 Left source code versioning button( version-control ), ② Copy repository (Clone Repository) in the browser. A window for entering an address will appear, ③ Paste the HTTPS address (remote storage address) you copied earlier and press Enter.

[ 지역 저장소 폴더 지정 ]
[ Specify a local storage folder ].

Select a location to save the remote repository to on your local machine (a local storage folder, in my case Documents\vscode-test), and then click 'Select Repository Location' to open the notification window on the bottom right. ③ Click 'Open' to open the cloned repository in the currently open VS Code window. The remote repository clone location folder (VSCODE-TEST) is displayed in the upper left EXPLORER section (VS Code Explorer).

You can think of this as laying the groundwork for the remote and local repositories to connect to each other.

3. Register your Git username

In order to process commits in VS Code, you must first use the Git user information (username, user email address)for each task. This is just a way of marking the work of multiple people so that you can see who did what. Open a VS Code terminal window and run the following commands in sequence 

[ 깃 사용자 정보 등록 ]
[ Register Git User Information ].
git config user.name "User name"
git config user.email "User email address"

4. add files and create VS Code Commit

지역저장소에 파일 추가
[ Add files to local storage ].

Now let's actually create a new file to create a commit. Click the New File icon to create a new file named "README.md" inside the remote repository clone location folder (local storage), type anything in the contents field, and click the Source code versioning iconwill display the number 1 (⑤). This is an automatic way to let you know that new changes exist.

Note that if changes are made to the file but not saved, you will see a white dot as shown in ④. Press Ctrl + S to save your changes, and the mark will disappear.

VS Code Commit
[ VS Code Commit ]

Click the source code versioning icon ② Click '+' and the README.md file will be ③ Staged. Enter a commit message ④ and click the 'Commit' button ⑤. The commit message you enter can be understood as a text for your records to know what you did in this step later.

5. register remote repository commit

[ Push 버튼을 클릭하여 원격 저장소로 파일 업로드]
[Upload files with Push].

So far, we've been working through the process for version control on our local repository (my computer). Now, we're going to work through the process of transferring these tasks to a remote repository as a set. From the screen in the previous step, click the three-dot menu (Views and More Actions...) and then click Push to upload the README.md file to the remote repository (GitHub).

[ 업로드한 커밋 일체 깃허브에서 확인 ]
[ Check all uploaded commits on GitHub ].

If you go to GitHub and access the repository, you can see that ① the file (README.md) has been uploaded, ② the commit message (init) has been confirmed, and ③ the details of the uploaded file have been confirmed, as shown below.

Organize

In this post, we learned how to integrate GitHub with VS Code. First, we created a remote repository on GitHub and cloned it to a local repository. After registering our Git username to use it as a tool for version control checks later, we added files and ran commits. Finally, I finished uploading from my local to the GitHub server, a process that moves all the work done on my computer to the remote repository.

The world of Git and GitHub has another profundity, which we'll cover later.

Today, we've learned how to integrate GitHub-VS Code, which seems difficult but is actually not that difficult once you do it a few times. For reference, we'll show you how to use the Integrating GitHub RStudio You can also learn how to integrate with other GitHubs in this post.

Terry on Life2.0: IT Playground, the second life creation assistantwas.

All content on 'secondlife.lol' is protected by copyright law. Unauthorized reprinting, copying, distribution, etc. is prohibited.

Similar Posts