[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[Global exclusive service] Beyond's MSP in North America and China

[Global exclusive service] Beyond's MSP in North America and China

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

Let's operate Git with VS Code!

Nice to meet you, I'm Nagato from the System Development Department!
This time, I will explain how to operate the version control system "Git" from vscode.

We will explain six basic Git operations in the following order.

・Branch switching & creation
・Commit & push
・ Pull
・ Merge (conflict resolution)

Switching & creating branches

There is a field at the bottom left of the screen where the branch name is written.

Clicking there will display a dialog at the top where you can create and switch branches.
"Create new branch..." allows you to create a child branch of the current branch.

Enter the name and press Enter to complete!

If you look at the bottom left column, you can see that you have switched to the branch you created earlier.
At this stage, we are only creating a local branch, so click the Publish button next to it to create a remote branch.

commit & push

Next, let's commit and push.
Edit the file a little. Then, there is a tab displayed as ① in the sidebar.
This shows that there is one edited file.
tab and click the + next to the edited file name.

You can then move to "Staged Changes".
You can only commit files that have been moved to this "staged changes", so
you can distinguish between what you want to commit and what you don't want to commit yet.

Enter a comment in the text box and click check to complete the commit.

Finally, let's do a pull.
Simply click on the part marked 1↑ at the bottom left to complete the pull.

pull


just click on the part marked 1↓,
just like the previous push If there are any files that have been changed or added to the remote branch, a number of 1 or higher will be displayed here, so check them carefully.

Merge (conflict resolution)

Finally, let's merge and resolve conflicts.
Move to the tab on the left and click on the "..." part.
You can also perform operations such as commit, pull, and push from here.
This time, select "Merge Branch..." from "Branch".

A dialog will then appear where you can select the branch you want to merge.

After selecting a branch, merging will occur automatically.
When a conflict occurs, the current changes (changes on a different branch) and changes on the input side (changes on the merge branch) are color-coded like this.

"Import current changes | Import changes from input side | Import both changes | Compare changes"
above the conflicting , and you can select it.
This time, select "Import both changes."

The changes were applied and the conflict was successfully resolved.
Once you commit and pull, the reflection on the remote branch is complete.

summary

You can open the console with Ctrl+Alt+@, so you can still perform the same operations as before using git commands.
However, managing git using VScode is intuitive, easy to understand, and smooth, so please give it a try.

lastly

I have opened the system development service site "SEKARAKU Lab" to which I belong.
Beyond is a one-stop service for everything from server design and construction to operation, so if you have any trouble with server-side development, please feel free to contact us.
SEKARAKU Lab: [https://sekarakulab.beyondjapan.com/](https://sekarakulab.beyondjapan.com/)

If you found this article helpful , please give it a like!
1
Loading...
1 vote, average: 1.00 / 11
12,183
X facebook Hatena Bookmark pocket
[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

The person who wrote this article

About the author

Masaki Nagato

Joined as a new graduate in April 2020.
My name is Nagato and I belong to the System Development Department. He mainly develops web systems and game APIs using PHP.
Qualification: PHP7 engineer certification beginner level