Git: Upload local project to Github

In this topic I try to explain how to upload local project to Github.

Firstly we need to create a Github repository. You can click add new repository button on Github and you will see a screen like below.

Github create repsitory. | Furkan Ozkaya

Repository Name: You can write your project name or you can specify technologies which did you use in this project like me 🙂

Description: You can write a brief explanation about the project. You can give information about the project or you can redirect to the live app of your project.

When creating repository Github gives you two option: Public and Private.

Public: Everyone can see and contribute your project.

Private: Only you and people you let will see and contribute to the project.

If you click Initialize this repositor with a README. Github will add readme file which contains project name. I wrote this file in my local so i didn’t add this file.

When you click create repository you will see a screen like below. This screen contains stages for pushing projects to Github.

Stages for pushing project to github. | Furkan Ozkaya

Firstly go your project folder and open git bash. Initialize git with given command.

git init

When you run this code, this command will create .git folder but you may not see it because it’s hidden. If you want to see you can check the hidden items check box in view section.

For adding your files to staging area you can run fallowing command.

git add .

If you want to add files one by one you can use code below.

git add file_name
Git add . resutlt | Furkan Ozkaya

When you run the following command you will display changed, added or deleted files from your project.

git status

And then you need to record these changes to the local database with the following command.

git commit -m "commit message"
This image has an empty alt attribute; its file name is git_commit-1024x619.png

You can write your commit message inside quotes.

If you want to write long commit message you can split it with -m option.

Okay, we are good so far. Now we need to send our changes to the server for that we need to add a remote server.

git remote add origin https://github.com/FurkanOzkaya/postgresql_json_excel.git

With this code you can bind your local database to remote server.

If you didn’t make your git configuration you should make them with following commands. If you don’t make them git always will ask for username etc.

git config --global user.name "Furkan Ozkaya"
git config --global user.email "furkanozkaya45@gmail.com"

Finally we will send our local recorded changes to the remote server. We can make it with following command.

git push -u origin master
git push origin master | Furkan Ozkaya

Now everything seems good. you can check your project files in the Github repository.

Add a Comment

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