From 76baead0d908706336985b4eda821fc1e7155988 Mon Sep 17 00:00:00 2001 From: honney Date: Thu, 20 Nov 2025 18:31:46 +0000 Subject: [PATCH] Update git/overall.md --- git/overall.md | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/git/overall.md b/git/overall.md index 8522361..19f96a9 100644 --- a/git/overall.md +++ b/git/overall.md @@ -13,4 +13,38 @@ git switch 'branch' # A new branch ``` git switch -c 'branch' -``` \ No newline at end of file +``` + + +## Creating a new repository on the command line +``` +touch README.md +``` +``` +git init +``` +``` +git checkout -b main +``` +``` +git add README.md +``` +``` +git commit -m "first commit" +``` +``` +git remote add origin git-https-url +``` +``` +git push -u origin main +``` + +## Pushing an existing repository from the command line + +``` +git remote add origin git-https-url +``` +``` +git push -u origin main +``` +