How to bulk move multiple files with GitHub Desktop

Published March 9, 2021; last updated on September 10, 2021
How to bulk move multiple files with GitHub Desktop

Moving multiple files at once in the online GitHub environment is not really handy. You’d have to change the name for each individual item and you can’t just drag-and-drop items. One of the easiest ways to bulk move files is by using the GitHub Desktop app. I’ll show you how to do it.

What is GitHub Desktop?

The first step is to install the GitHub Desktop app. The Desktop app is a simple client to work locally with your GitHub repositories. It eliminates the need to go to your terminal or command line and it provides a user-friendly interface to do commits, releases and pull requests.

You can download GitHub Desktop for both Windows and macOS. Install the app, login and grant it access to your repositories.

Now we’re going to clone a repository to our local environment. Then, we’ll make our edits here and push the changes back to the server.

Cloning a GitHub repository to your computer with GitHub desktop.

Now that you’ve a repository cloned to your desktop, you ‘ll see this screen:

The private repository in the GitHub desktop app.
The GitHub Desktop app after opening a repository.

Click Show in Finder to show the files of the repository in your file explorer (I’m using Mac). You’ll see something like below:

The local copy of the files with GitHub Desktop.

In my case I’m using a repository with the files for a WordPress theme. All those files are now in the first level of the repository. Say that I want to put them all in one folder and put some readme’s in the first level.

To do so, select all the files and create a new folder with the items just like you’d normally do in your file explorer. Restructure the files and do all the bulk moving which you need to do.

Create a new folder with the files.
The final folder with the files.

Pushing the files to the server with GitHub Desktop

Great! Now you have successfully changed the file structure of your repository and you’ve bulk moved files. But there’s still one last step to take. The files now only live on your computer and we want to push them to the cloud.

Open up the GitHub Desktop app again and you’ll see that it has detected all the changes. Give a summary and click Commit. Click Push origin to push the files to the server.

The files are removed and added again in order to allow moving multiple files.

Bulk move files with GitHub

As you’ve seen, it’s very easy to bulk move files with GitHub by using the GitHub Desktop app. This is a huge timesaver if you’d otherwise rename files and you don’t have to resort to some complex command line tool.

It must be noted, though, that there’s one downside to this method too. GitHub now thinks that you’ve 1) removed a lot of files and 2) added a lot of new files. This means that merging two branches may bring some difficulties with it. I therefore recommend this method if you don’t have a lot of branches that you want to merge in the future.

Stay up to date with all things Laravel, Tailwind, WordPress & PHP

Subscribe now to my e-mail newsletter and get my latest articles and project updates delivered directly to your inbox. Never miss an update.

Image Ralph J. Smit
Ralph is a designer gone developer. He happily lives in the Netherlands. His passion for good design drove him towards development, because he felt that no-code tools were too limiting. On this blog, Ralph writes the articles he would've wanted to have during his continual developer journey. → Follow on Twitter

Comments

Leave a reply

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

Close
Do you want more articles like this delivered straight to your inbox?

Subscribe now to my e-mail newsletter and get my latest articles and project updates delivered directly to your inbox. Never miss an update.