Git

12 July 2023 / 1 min read

Updated: 12 July 2023

# Create a new repository on the command line

echo "# Something" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/[username]/[repo].git
git push -u origin main

# Push an existing repository from the command line

git remote add origin https://github.com/[username]/[repo].git
git branch -M main
git push -u origin main

# Common Problem

Notes to troubleshoot

# Contributions not showing on profile

Make sure your config is match
Email:

git config --global user.email

Name:

git config --global user.name