Posting Project to GitHub — Full Commands
Initialize Git (only if not already done)
bash
Copy
Edit
git init
👉 This makes your project folder a Git repository.Add all files
bash
Copy
Edit
git add .
👉 This stages all the files to be committed.Commit your changes
bash
Copy
Edit
git commit -m "Initial commit"
👉 This saves your changes with a message.Create a repository on GitHub
Go to https://github.com
Click ➡️ New Repository
Don't initialize with README (you already have files locally).
Copy the GitHub URL (it looks like https://github.com/username/repo-name.git)
Connect local repo to GitHub
bash
Copy
Edit
git remote add origin https://github.com/username/repo-name.git
👉 Replace https://github.com/username/repo-name.git with your actual GitHub repo URL.Push to GitHub
bash
Copy
Edit
git push -u origin main
👉 If your branch is called master instead of main, then:
bash
Copy
Edit
git push -u origin master
✅ Your project will now be live on GitHub
git blame
See who changed each line of a file and when.
bash
Copy
Edit
git blame filename
Useful for debugging historical changes in the code
Top comments (0)