Skip to content

Instantly share code, notes, and snippets.

@abhitrueprogrammer
Last active October 20, 2024 07:41
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 "[email protected]"
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 [email protected]: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 [email protected]:USER-NAME/REPOSITORY-NAME.git
#Pushing is as simple as
git push origin {branch_name}
#flow is:
#branching
git branch
git switch branch_name
#branching
git add .
git commit -m "msg"
git push
@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