Getting changes from a remote repository
You can use common Git commands to access remote repositories.
Options for getting changes
These commands are very useful when interacting with a remote repository. clone and fetch download remote code from a repository’s remote URL to your local computer, merge is used to merge different people’s work together with yours, and pull is a combination of fetch and merge .
Cloning a repository
To grab a complete copy of another user’s repository, use git clone like this:
You can choose from several different URLs when cloning a repository. While logged in to GitHub, these URLs are available below the repository details:
When you run git clone , the following actions occur:
- A new folder called repo is made
- It is initialized as a Git repository
- A remote named origin is created, pointing to the URL you cloned from
- All of the repository’s files and commits are downloaded there
- The default branch is checked out
For every branch foo in the remote repository, a corresponding remote-tracking branch refs/remotes/origin/foo is created in your local repository. You can usually abbreviate such remote-tracking branch names to origin/foo .
Fetching changes from a remote repository
Use git fetch to retrieve new work done by other people. Fetching from a repository grabs all the new remote-tracking branches and tags without merging those changes into your own branches.
If you already have a local repository with a remote URL set up for the desired project, you can grab all the new information by using git fetch *remotename* in the terminal:
Otherwise, you can always add a new remote and then fetch. For more information, see «Managing remote repositories.»
Merging changes into your local branch
Merging combines your local changes with changes made by others.
Typically, you’d merge a remote-tracking branch (i.e., a branch fetched from a remote repository) with your local branch:
Pulling changes from a remote repository
git pull is a convenient shortcut for completing both git fetch and git merge in the same command:
Because pull performs a merge on the retrieved changes, you should ensure that your local work is committed before running the pull command. If you run into a merge conflict you cannot resolve, or if you decide to quit the merge, you can use git merge —abort to take the branch back to where it was in before you pulled.
3 Ways to Download GitHub Directories and Repositories
This article was co-authored by Luigi Oppido and by wikiHow staff writer, Travis Boylls. Luigi Oppido is the Owner and Operator of Pleasure Point Computers in Santa Cruz, California. Luigi has over 25 years of experience in general computer repair, data recovery, virus removal, and upgrades. He is also the host of the Computer Man Show! broadcasted on KSQD covering central California for over two years.
The wikiHow Tech Team also followed the article’s instructions and verified that they work.
This article has been viewed 157,440 times.
Do you need to download a folder from GitHub? GitHub doesn’t give you the option to download a specific folder directly, but you can still easily do so using a third-party tool. GitHub does allow you to download an entire repository through the website, as well as clone a repository to your computer using GitHub Desktop. This wikiHow teaches you 3 ways to save GitHub folders and repositories to your computer.
How to Download From GitHub: A Beginner’s Guide

GitHub is one of the largest developer resources, and an absolute must-know for aspiring web developers to explore and share projects online.

If you’re just starting out with git and GitHub, taking open-source code from GitHub to experiment with or add to your own projects is one great way to learn. To do that, you’ll need to learn the basics: getting a file from GitHub onto your computer.
How to download files from Github
Cloning or pulling an entire Git repository is a task developers performs day to day. But sometimes, you only need one or two files from the repository. It’s a frustration that Git does not allow you to pull a part of the repository instead of the whole thing. Using Github, you can download a single file from a Git repository.
In this article, we will show you how to download a single file from GitHub and show you examples in which we download files using a command line utility and common web browser.
Download a single file from Github
The web-based interface of Github allows you to download one file at a time from a repository.
In order to do that, you need to navigate to your desired file on the Github website. You will see a «Raw» button on the top right corner of the box which display the file contents. Clicking the button will redirect you to the actual file.
Please do note that the file is served by Github in plain-text mode, which means a text file won’t be automatically downloaded. Instead, the content of the text file will be displayed right inside the browser.
After seeing the file content, you can press Ctrl+S to save it wherever you want, as you would with any other internet resource.
Alternatively, you can right-click Raw button and choose Save link as. The Save as dialog will pop up and lets you choose the location you want your file to be saved in.
If the file you want to download is not a text file, then clicking Raw will trigger the download process immediately without loading it to the browser.
In the example below, we are viewing main.go (a text file) in gitea repository. To download main.go, you have to right-click Raw and choose Save link as.

Download folder/directory from Github
If you’re using Google Chrome, there is an extension that lets you download an entire folder/directory in a Github repository as a zip file.

Once you’ve got the extension installed, visit any Github repository from the browser. In this example, we want to download docs directory from gitea repo.

Right-click docs , you will see a Save as option with Developer’s Download Helper icon. Clicking on the option will automatically zip the folder and trigger the download process.
The zipping process can take some time to finish, especially if the target folder contains a large number of files. In that case, please be patient and wait. You can safely switch over to another tab or application to do other things as long as you don’t close Github tabs.

Developer’s Download Helper also supports downloading folders from Gitlab using the same process.

The steps above also applies to Chrome-based browsers such as Microsoft Edge, Opera, Vivaldi, Brave, etc.
Download multiple files and folders from Github using browsers
GitZip for github is a Chrome extension that lets you download more than just one folder/directory at a time. The extension is capable of compressing both directories and files inside a Github Repository to a zip file and download it. You don’t have to download or clone the whole project just to save a few folders/directories you need.
Once the installation is finished, you have to authorize GitZip for github to access your Github account information. In order to do that, visit Github.com and click GitZip icon in the top right corner toolbar of Chrome, then select Normal to begin the process.

You will be redirected to a page where you can authorize GitZip to access your account information, click Authorize GitZip to continue.

Once the access token has been grabbed, you will see a successful message and be redirected back to the previous page. Now that GitZip is enabled, you can visit any Github repository to see it in action.
In any Github repository page, you can double click any file or folder/directory to select it. After you’ve done choosing, hover your mouse to the lower right side of the browser window, you will see Download checked items button. Clicking the button will trigger the zip-and-download process immediately.
Please do note that GitZip will take some time to fully process large repository. While waiting for it, you can switch over to other tabs to finish your business. As long as the Github tab isn’t closed, the extension is working fine.