Skip to content
LogoTechnipages
LogoTechnipages
  • Topics
        • Android
        • Browsers
        • Gaming
        • Hardware
        • Internet
        • iPhone
        • Linux
        • macOS
        • Office
        • Reviews
        • Software
        • Windows
        • Definitions
        • All Recent Posts
  • Product Reviews
  • About

How to Pull a Git Repository in Linux

Mel HawthorneSeptember 24, 2020 Comments (0)

Git defines a version control processes for how projects should be shared. Many websites exist that allow you to host your Git projects. GitHub is the most popular option, Bitbucket is another popular alternative, both allow free accounts that can create unlimited public or private repositories. GitLab offers a self-hosted alternative allowing for private development without relying on third-party hosting.

The process to first download a Git repository is called cloning. Cloning includes all the information about the repository at the time, however, to keep the repository up to date over time you need to pull down new versions. To do so, simply open a terminal window in the directory with the local version of the repository and type the command “git pull”.

The operation of this command is particularly simple if you’re just wanting to download an updated version of the repository; the local version will be updated to match the remote version. You may, however, see that there could be issues if you’ve made modifications to your local version.

The command “git pull” actually runs two separate commands “git fetch” and “git merge FETCH HEAD”. The sub-command “git fetch” specifically pulls down the newest version from the online repository and temporarily stores it. The sub-command “git merge FETCH HEAD” then merges your local changes with the downloaded version, with newer commits being preferred.

Tip: A “git commit” is a submission of a change, it’s possible to have multiple local and remote commits that do the same or different things. Local commits are not visible to the remote version until the changes are pushed. Each commit details exactly what changes were made and include a timestamp.

Conflicts between local and remote versions

Ideally in a merge scenario, there will be no conflicts and the merge process will complete automatically. Merges can be particularly easy if few changes were made, or if your local changes don’t interfere with any remote changes. If, however, there are conflicting complex changes to the same part of the code Git will throw a merge error.

At this point, you can either abort the merge with the command “git merge –abort” or try to manually resolve the conflicts. The commands “git mergetool” and “git diff” provide a graphical example of the differences that should help to make it as easy as possible to see what changes need to be manually applied to allow the merge to complete. Once you’ve resolved all of the conflicts, type the command “git merge –continue” to complete the merge.

The command “git mergetool” will open a graphical tool like this to help you manually resolve conflicts.

Categories: Internet

Author Mel Hawthorne

You Might Also Like

  • Google Duo on Android: How To Add Automatic Captions To Video and Audio Messages

    Mel HawthorneAndroid
  • Slack: How To Hide Who Is Currently Typing a Message

    Mel HawthorneInternet
  • Slack: How To Configure Automatic Slackbot Responses for Your Workspace

    Mel HawthorneInternet
  • Google Duo: How To Configure Which Audio or Video Devices You Use

    Mel HawthorneInternet

Leave a Reply

Your email address will not be published. Required fields are marked *

fix 0x80070302 windows update error

How to Fix the 0x80070302 Windows Update Error

how to allocate more memory to a program

How to Allocate More Memory to a Program in Windows

marvel rivals memory leak fix

Marvel Rivals Using Too Much Memory – How to Fix

how to create a macro in word

How to Create a Macro in Word

how to set video as screen saver

How to Set a Video as Your Screen Saver on Windows 11

profile pic

The Experts Behind Technipages

My name is Mitch Bartlett. I've been working in technology for over 20 years in a wide range of tech jobs from Tech Support to Software Testing. I started this site as a technical guide for myself and it has grown into what I hope is a useful reference for all.

Learn More

technipages logo white
linkedin icon

Technipages is part of Guiding Tech Media, a leading digital media publisher focused on helping people figure out technology. Learn more about our mission and team here.

© 2025 Guiding Tech Media All Rights Reserved

  • About Us
  • Contact
  • Legal & Privacy

© 2025 Guiding Tech Media All Rights Reserved

Information from your device can be used to personalize your ad experience.
Do not sell my personal information.

Last Updated on September 24, 2020 by Mitch Bartlett