How to Upload Files to Git hub

A Brilliant Way of Uploading Files to GitHub

GitHub is a web-based interface that allows real-time collaboration. It encourages and creates a safe space for teams to come together and work on developing codes, building web pages, and updating content. This time we will be looking at how to upload through it.

The biggest reason behind this writing is to eliminate the drag-and-drop method where someone will create a remote repository and then just drag the file into GitHub like that. Aside from the fact that this is not an efficient way of uploading, it will not allow all files to transfer in this process. I know this because I tried it myself.

First things first will be to create a GitHub account.

https://github.com/

If you don’t have an account, click the link above and create one. If you already have then just sign in. Once you have done all that, you;

  1. Go to Your repositories by the right hand under your status and then click on New.

2. Put your desired Repository Name.

3. You can add a description if you want to. Let’s put the First time on Github

4. You can either choose yours to be public or private. If you put it on Public then anyone on the Internet can the repository but if you put Private you can see it and commit to this repository.

It should look something like this;

5. Then click on Create Repository.

After doing that, you will see the step-by-step commands to create either a new repository on the command line or push an existing repository from the command line.

To start getting our local projects onto Github.com, we need to download git to have access to all those commands. To get git, you just search git and then download it for your machine. Then just set it up. Now that we have git installed, we can now utilize the

https://git-scm.com/

Click the link above and follow the instructions to get Git on your device. Is a swift, easy, and fast process.

Now that we have git installed, we can now utilize the commands. Let’s run through some of the commands real quick, they are:

1. git init- This initializes a new repository

2. git status — This shows what you have in your staging area

3. git add — This adds files and folders to the staging area

4. git commit- commits files in the area to the local repository

5. git push- Takes a local repository and pushes to a remote repository in this case GitHub.

We will run all these commands on the terminal on our device. That will be Command prompt on Windows or you can use Git Bash. Before we forget, let’s create a folder with our repository name in Desktop.

So open your terminal

  1. Firstly we do the

    git --version

    just to see if everything was connected successfully.

  2. Then put in

    cd Desktop
    where we created our folder to move any change or any file needed there

  3. Then put in the CD and the name of the project or document. In simple terms, put cd your file name

    For example;

    cd Gold

  4. Next is to run through

    git init

    This will create a folder in that folder or project that we have. To see it you go to the folder, you go to view, and then press on hidden item because by default it is hidden

    5. You then check your documents are ready for transfer by running the Command

    git status

    1. The files will usually be red in the terminal which you will now run the command

      git add .

      Then you can run git status again then you will see they all green meaning your files are ready to be committed.

    2. Now to add them to the git folder we created, we commit it by running it through git commit by inputting the command

      git commit -m "put in a message"

      You can put any message there, we are just using that as a template.

      8.For the conclusion of the transfer, when you go back to your Github under the create a new repository on the command line just copy and paste the git remote command in your command prompt or Git Bash

      9. Finally, now that it knows the URL to push it to, let’s go ahead and push it by using the command git push or you can still just copy and paste and run that command.

      These are quick steps to upload your Files to Github. I hope you will find this helpful and educative as you venture into your Git adventure.