Skip to content

Techeons

Imagine | Explore | Innovate

Menu
  • Home
Menu

Cheat Sheet: Setting up a new Git Repo on a Git Hosting Service

Posted on September 6, 2025

A quick access to Git commands to setup a new repo on a Git Hosting Service.

There are several Git Hosting Services such as GitHub, GitLab, Bitbucket, Azure DevOps Repos and more.

Create a new repository on the command line

echo "# <Your Project Name>" >> README.md
git init
git add README.md
git commit -m "First commit"
git branch -M main
git remote add origin https://<your-git-hosting-service>/<your-repo-name>.git
git push -u origin main

…or push an existing repository from the command line

git remote add origin https://<your-git-hosting-service>/<your-repo-name>.git
git branch -M main
git push -u origin main

Checkout your Git Repo where you need it

git clone https://<your-git-hosting-service>/<your-repo-name>.git
git checkout <branch-name>


Share on Social Media
x facebook pinterest linkedin tumblr reddit emailwhatsapptelegrammastodon

Leave a Reply Cancel reply

You must be logged in to post a comment.

Recent Posts

  • Nginx: How to increase timeout for Nginx
  • Cheat Sheet: Essential Git Commands
  • Setting a default shell in Linux
  • Setting up Composer on Linux
  • Switch easily between Python versions on a Mac using pyenv

Tags

ai alerting aws b2 backblaze certificate cheatsheet cloud commands data-science datalake devops dns docker dremio git gitlab infra jenkins kubernetes linux metabase minikube minio monitoring mount mysql nginx nodejs notebooks openssh php python scala secrets spark ssh ssl ubuntu ufw usb web dev tools windows xampp zeppelin

©2026 Techeons | Design: Newspaperly WordPress Theme