Skip to content

Instantly share code, notes, and snippets.

@suhailroushan13
Last active March 11, 2025 15:49
Show Gist options
  • Save suhailroushan13/1a2769279140019771c93c994b51e315 to your computer and use it in GitHub Desktop.
Save suhailroushan13/1a2769279140019771c93c994b51e315 to your computer and use it in GitHub Desktop.
GitHub Setup
Git and GitHub Setup
To Install Git In Ubuntu
1. sudo apt update && sudo apt install git -y
2. git --version
To Install Git In MacOS
1.brew install git
2.git --version
Configure Git in MacOS & GitHub
git config --global user.name "GitHub username"
git config --global user.email "GitHub email"
// To Verify Configuration
git config --list
// SSH Keys Setups
1.To securely connect to GitHub, set up SSH authentication.
On Ubuntu & macOS
Generate a new SSH key (press Enter for default file location):
ssh-keygen -t ed25519 -C "GitHub email"
2. Press Enter 4 Times
3. cd .ssh
4. you will see 2 files
i.public key
ii. private key
5.cat the public key
ex : cat id_ed25519.pub
6.Add the key to GitHub:
Go to GitHub → Settings → SSH and GPG keys.
Click New SSH Key and paste the key.
7. Test the Connection
ssh -T [email protected]
8.Clone any Repository and Type yes
Methods of GitHub to Use :
Method 1:
(When you are starting a new project / new code base)
or when nothing has been started ...then use method 1:
1. Go to GitHub.com
2.click on your profile and search your repositories
3.Click on New Repository
4.Give a CamelCase Repo Name
Ex: zomatoApp, projectManagement, schoolApp
5.Select Public or Private
6.Check on Add ReadMe Check Mark and Click on Create New Repo
7.Copy SSH URL From Repo
8.Go to your Terminal
9.git clone ssh-url
10. cd reoName
11. mkdir folderName ==> to create a folder
touch filename ==> to create a file
Create a few files & folders or Complete your codebase
12.To Push the code to Cloud Platform GitHub
i. git add .
ii. git commit -m "description of what you code"
iii. git push origin main
13. check your changes in GitHub platform with commit message
Method 2:
Use method 2 only if you have already code base
and you want to push that code base to the GitHub
1.Make sure you have all folders and files ready to push to GitHub
example : zomatoProject
where it should have files and folders
and No empty folders
2.Go to GitHub.com and create a new repository with a
camelCase Name and No Space in repo Name
and it should be same name as your folderName in local machine
3.Select public or private
4. DON'T SELECT Add a README.md check mark
5. Click on create a new repository
6. Copy the SSH URL of the Repo
7. come to your terminal and visit your folder project
example : cd zomatoApp
8. git init
it will create a .git folder inside a hidden one
9. git remote add origin ssh-url
10. git remote -v
11 git add .
12. git commit -m "meaning full message of commit"
13. git push origin main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment