Arama Yap Mesaj Submit
Request a Callback
+90
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro

Contact Us

Location Halkali merkez neighborhood fatih st ozgur apt no 46 , Kucukcekmece , Istanbul , 34303 , TR

Uploading the Projectctct to GitHub Using Git with CMD

2026 A to Z command line guide in compliance with DevOps standards. Manage version control systems professionally.

BASH
user@ekasunucu:~/proje$ go init
Initialized empty Git repository in /project/.git/ user@ekasunucu:~/proje$ go add .
user@ekasunucu:~/proje$ go commit -m "Initial commit"
user@ekasunucu:~/proje$ go push -u origin main
Enumerating objects: 15, done... Writing objects: 100% (15/15), 2.45 KiB...

In this article, we explain in detail the process of uploading (push) a folder or files on your computer to GitHub using Git via Windows CMD (Command Prompt). Whether you're starting a project from scratch or moving an existing project to GitHub, this guide has been prepared according to 2026 software standards.

Not: This tutorial focuses on Windows CMD; however, the commands are %99 the same in Git Bash, PowerShell and Linux/MacOS terminals. For Git management on the server side Eka Sunucu VPS You can review our services.

1. Requirements and Git Installation

Before importing your projects into the version control system, you need to meet the basic requirements. In 2026 ,%95% of software development processes are Git-based.

  • Git Must Be Installed: It is essential to have Git software installed on your computer.
  • GitHub Account: A cloud account (GitHub, GitLab, etc.) to host your projects.
  • Access Authorization: 2026 HTTPS (Token) or SSH Key in accordance with security standards.

Go Installation Control

Open CMD and run the following command. If you see the version number, the installation is complete.

CMD
C:\Users\Eka> go --version

If it is not installed git-scm.com You can download and install it from .

First Setup: Identification

Git wants to know who made the commits. You only need to make this setting once.

CMD
C:\Users\Eka> go config --global user.name "Your Name and Surname"
C:\Users\Eka> go config --global user.email "[email protected]"

2. Scenario A: Creating and Pushing a GitHub Repo from Scratch

You have a new project on your computer and you are going to upload it to GitHub for the first time. Let's proceed step by step.

2.1. Going to the Projectctct Folder

CMD
C:\Users\Eka> cd C:\projects\my-project

2.2. Initializing the Git Repo (Init)

This command is in your folder .git Creates a hidden administrative folder named .

CMD
C:\...\my-project> go init

2.3. Changing the Branch Name to 'main'

'master' used to be used, but the modern standard is 'main'.

CMD
C:\...\my-project> go branch -M main

2.4. Stage and Commit Files

We add all the files and save our first version.

CMD
C:\...\my-project> go add .
C:\...\my-project> go commit -m "Initial project files loaded"

2.5. Link and Push with GitHub

After creating an empty repo on GitHub (Repo Create), connect your local project to the remote server using the HTTPS or SSH link provided to you.

CMD
# Add remote server with name 'origin'
C:\...\my-project> go remote add origin https://github.com/kullaniciadi/proje.git

# Send files
C:\...\my-project> go push -u origin main

Are You Ready to Take Your Projectctct Live?

Publish your PHP, Node.js or Python projects that you uploaded to GitHub on Eka Sunucu's high-performance cloud infrastructure. Maximum speed with NVMe SSD disks and 10 Gbit line.

Check out Web Hosting Packages

3. Scenario B: Submitting Projectctct to Existing GitHub Repo

If you want to send your own local files to a repo that already has files on GitHub (for example, there is README.md in it), the method changes.

3.1. Cleanest Method: Clone

First, download the repo to your computer, add your files into it and send it. This prevents conflicts.

CMD
C:\projeler> go clone https://github.com/kullaniciadi/var-olan-repo.git
C:\projeler> cd var-olan-repo

Now copy your project files to this folder and continue with the standard process:

CMD
C:\...\repo> go add .
C:\...\repo> go commit -m "New features added"
C:\...\repo> go push

4. GitHub Authentication: SSH and Token

GitHub no longer allows password pushes (since 2021). There are two main methods:

Method 1: HTTPS Token (PAT)

Create a token from GitHub Settings > Developer Settings > Personal Access Tokens. Paste this token when asked for password when pushing.

Method 2: SSH Key (Recommended - Professional)

SSH provides a secure connection without entering a password. As Eka Sunucu Linux VPS We recommend using SSH in management.

CMD
# 1. Generate SSH Key
C:\> ssh-keygen -t ed25519 -C "[email protected]"

# 2. View and Copy Key
C:\> type %USERPROFILE%\.ssh\id_ed25519.pub

Add the resulting code to GitHub > Settings > SSH and GPG Keys. Then switch your repo connection to SSH:

CMD
C:\...\repo> go remote set-url origin [email protected]:username/project.git

5. Daily Use: Most Frequent Commands

Komut Description
git status Shows which files have changed.
git diff It shows line by line detail of the changes made.
git pull Pulls changes from the remote server (GitHub) to the local.
git log --oneline Lists past commits in summary form.
git branch Lists existing branches.
git checkout -b yeni-ozellik It creates a new branch and moves to that branch.

6. Common Errors and Solutions

1. fatal: not a git repository

Reason: You are in a folder that has not been git inited.
Solution: Enter the project folder or git init do it.

2. failed to push some refs

Reason: There are files on GitHub that you do not have (someone else may have committed them).
Solution: Before git pull --rebase do it, then push.

3. LF will be replaced by CRLF

Reason: Windows and Linux line ending difference.
Solution: It's usually not a problem, Git handles this automatically. To set: git config --global core.autocrlf true

Need an Enterprise Git Server?

If you want to keep your data on your own server instead of GitHub, you can download Eka Sunucu VDS packages. GitLab or Gitea You can create your own private Git server by installing

Check out VDS Packages

Frequently Asked Questions

What is the difference between Git and GitHub?

I committed files by mistake, how do I get them back?

Which files should I not upload to Git?

How do I upload large files (100MB+)?

Can Git be used on Eka Sunucu hosting?

Top