DEV Community

Shawon Saha
Shawon Saha

Posted on

1 2

Upload existing project to github repository through command line

At first create a repo from your github account

alt text

Now head back to the folder you want to push to github. It'll look something like this in terminal ~/foldername$. Now Type and run

git init
Enter fullscreen mode Exit fullscreen mode

This command will create a hidden folder .git

Head back to terminal and type

git add .
Enter fullscreen mode Exit fullscreen mode

Remember to put the (dot). This will make all your file in that folder to be committed.

At this point you have to configure your name and email to run commit command.

git config --global user.email "you@example.com"

git config --global user.name "Your Name"
Enter fullscreen mode Exit fullscreen mode

Replace Your Name and email and run the commands separately.

Now you are ready to be committed

git commit -m "Your Commit Message"
Enter fullscreen mode Exit fullscreen mode

Head back to browser and go inside your newly created repo again. You'll find a link like this pattern https://github.com/username/repository-name.git
If you don't find tap on Clone or download and copy the link. Make sure 'https' is selected not 'ssl'

In terminal type

git remote add origin https://github.com/username/repository-name.git
Enter fullscreen mode Exit fullscreen mode

Then run

git push -u origin master
Enter fullscreen mode Exit fullscreen mode

Now Put your github username and password

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay