Deleting A File From Your Local Repo

Goal: In this exercise you will familiarize yourself with the process of removing (deleting) a file from your local repo, using GitKraken.

WARNING: You must do this exericse AFTER doing the exercise about working with the GitLab server.
In the previous exercises you made a change to your copy of a project online. 
In this exercise you will download your copy (including those changes) and you will continue to modify it.

You must finish the previous exercises first so that the changes you make at the end of those exercises will be downloaded in the this exercise.
 Your project on the GitLab server
Roadmap for these tutorials

Deleting a file from your local repo

It may be necessary to remove files from your local repo.  A previous tutorial explained how to remove a file from the GitLab server.  In this tutorial we're going to remove another file from your local repo (your copy of the project that's on your computer).  Once the file removal has been commited you can then push your project/repo to the GitLab server just like normal.

The first step is to start GitKraken. 

The second step is to find the Working Copy's folder/directory.  (Remember that there's instructions on how to find your working copy in a previous exercise).

At this point you should remove a file from the Working Copy folder.  If you've previously committed the file then it will be safe to delete it because git will have saved a copy of the file in your project's history.   

Once you've done that the main panel will change,and you'll see that the WIP (Work In Progress) line (at the top of the list of commits) now has a red box in it, to indicate the deleted file (box 1, below)

Just like for a normal commit you'll need to stage the file(s) (box 2), then type in a commit message (box 3), and finally commit the changes to your local repo (box 4).

Confirm that the changes are on the server

At this point you should log into the GitLab web site/web app, click on the name of the repo that you just pushed, then click on the Files tab in the left-hand column (this is (2), in the image below).  You should see the file listed in the main panel on the right.

If you don't see the files on the server you should double-check that you actually pushed the changes back to the server, much like you did in a previous tutorial.

If that doesn't fix it then you should spend some time troubleshooting the problem yourself.  If you can't figure it out after 20-30 minutes (and it's fine if you can't) then please seek help from someone else (e.g., classmates, study buddies, the BIT Open Lab tutor, the instructor, etc)