[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”

Team development is essential! Explaining git clone, fetch, pull

git

thank you for your hard work!
My name is Yamada from the System Development Department.

This time,
I will explain the differences between the frequently used git commands used in team development: git clone, git fetch, and git pull.

git clone

Command to clone a repository.
You can import project repositories created by others into your own environment.

```````````````````````````````````````````````` ````````````````$ git clone [repository to be cloned] [directory name (optional)] ________________________________________________________________

git fetch

Command to update remote tracking branches.
Bring the latest information from the remote repository to the local repository.

```````````````````````````````````````````````` ```````````````` $ git fetch [repository name (optional)] [branch name (optional)] ________________________________________________________________

However, since this only updates the remote tracking branch,
the updates will not be reflected in the current working branch.

When do you want to reflect your work?

If you want to reflect it in the current working branch, use merge.

```````````````````````````````````````````````` ````````````````$ git merge [branch name you want to reflect] ________________________________________________________________

git pull

After performing `git fetch` as explained above, perform `git merge origin/main`.

```````````````````````````````````````````````` ````````````````$ git pull [repository name (optional)] [branch name (optional)] ________________________________________________________________

How to use each command


Use this when there is nothing in your local environment, such as when starting a git clone

git fetch


when there is likely to be a conflict between the remote and local environments
, such as when importing a branch edited by another person, you want to confirm before merging.


It is often used for branches that are updated only by pull requests from other branches in a remote environment, such as
the git pull (Since there is basically no conflict with the local environment, there is no need to check the differences.)

summary

This time, we explained the differences between the frequently used git commands used in team development: git clone, git fetch, and git pull.
It is unlikely that you will do team development without using this command, so
if you learned about it for the first time today, we recommend that you understand it perfectly!

command name Content
git clone Command to clone an already existing repository
git fetch Command to update remote tracking branch
git merge Command to reflect the contents of other branches, including remotely tracked branches, into the current branch
git pull Command to update the remote tracking branch and reflect it in the working branch, etc.

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/

If you found this article helpful , please give it a like!
1
Loading...
1 vote, average: 1.00 / 11
10,493
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

Yuki Yamada

Joined Beyond Co., Ltd. in 2021
My hobbies are karaoke and board
games.My board games can no longer fit on one shelf, so I would like to buy a new shelf, but I am sad because I don't have a place to put a shelf at home.
He has experience in mold design and sales, and has gained a wide variety of experience and has settled into a job as a server-side engineer.
He is currently working on server-side development using PHP and Python.
He also wants to learn a front-end language in the future, and is interested in Next.js, a React-based front-end framework.