Skip to content

Instantly share code, notes, and snippets.

@abhitrueprogrammer
abhitrueprogrammer / git.sh
Last active May 26, 2024 08:31
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 branch <branch_name> -> Create branchname
git checkout <branch_name> -> Checkout branchname
git branch -> list branches
git merge <branch_name> -> Merge branch with main
git branch -d <branch_name> -> Delete branched merged into main