Skip to content

Instantly share code, notes, and snippets.

@abhitrueprogrammer
Last active May 26, 2024 08:31
Show Gist options
  • Save abhitrueprogrammer/2928a66df334c31b197653a1618a3469 to your computer and use it in GitHub Desktop.
Save abhitrueprogrammer/2928a66df334c31b197653a1618a3469 to your computer and use it in GitHub Desktop.
Guide to setting up github
git config --global user.name "Your Name"
git config --global user.email "yourname@example.com"
git config --global init.defaultBranch main
ssh-keygen -t ed25519 -C <youremail>
cat ~/.ssh/id_ed25519.pub
#copy the whole output
#Add SSH key to github [https://github.com/settings/keys]
#Copy your repo's SSH url.
git clone git@github.com:USER-NAME/REPOSITORY-NAME.git
#TO ADD LOCALLY CREATED FOLDER
git init -b main
git add . && git commit -m "initial commit"
or git remote add origin git@github.com:USER-NAME/REPOSITORY-NAME.git
#Pushing is as simple as
git push origin {branch_name}
@abhitrueprogrammer
Copy link
Author

Prefer creating a new repo then cloning its .git file and then pushing using it to avoid headaches.

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