Git is a distributed version control software system.
You initialized a fresh repo, but no remote exists yet, so Git can’t “set” it.
git init
Add the remote first.
git remote add origin https://github.com/<username>/<repo_name>.git # HTTPS
git remote add origin git@github.com:<username>/<repo_name>.git # SSH
Verify:
git remote -v
gh auth login
gh repo create airplane_mode --public --source=. --remote=origin --push
git branch -m main
If you already have files:
git add .
git commit -m "Initial commit"
git push -u origin main
git remote -v
git remote show origin # Detailed config
Add local repo to existing repo on Github.
git remote set-url origin https://github.com/<username>/<repo_name>.git # HTTPS
git remote set-url origin git@github.com:<username>/<repo_name>.git # SSH
Overwrite remote main with your local work.
git push -f origin main
git log
Copy commit hash → e.g. abc1234.
Create and switch to a new branch starting at that commit:
git checkout -b new-feature abc1234