Skip to content

Instantly share code, notes, and snippets.

@Komet-Kazi
Last active May 22, 2021 01:49
Show Gist options
  • Select an option

  • Save Komet-Kazi/71e2884f1c5ff690372a2acd6fc879c2 to your computer and use it in GitHub Desktop.

Select an option

Save Komet-Kazi/71e2884f1c5ff690372a2acd6fc879c2 to your computer and use it in GitHub Desktop.
Git - Notes to create or push repos to github

Create a new repository on the command line

echo "# Nice_Schedule" >> README.md git init git add README.md git commit -m "first commit" git branch -M main git remote add origin https://github.com/Komet-Kazi/.git git push -u origin main

Push an existing repository from the command line

git remote add origin https://github.com/Komet-Kazi/.git git branch -M main git push -u origin main

Remove the git history from repo

rm -rf .git

Recreate the repos from the current content only

git init git add . git commit -m "Initial commit"

create a new branch

git branch new-branch-name

change environment to the new branch

git checkout new-branch-name

create a change

touch new-file.py

commit the change

git add . git commit -m "add new file"

push to a new branch

git push --set-upstream origin new-branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment