Last active
October 20, 2024 07:41
-
-
Save abhitrueprogrammer/2928a66df334c31b197653a1618a3469 to your computer and use it in GitHub Desktop.
Guide to setting up github
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prefer creating a new repo then cloning its .git file and then pushing using it to avoid headaches.