git hub
dir
git init
git add .filename
git commit -m "initial commit"
git remote add origin [Link]
git branch -M main
git push -u origin main
linux github
1. Navigate to your project folder (or create one)
cd ~/Desktop # or wherever you want
mkdir my-project
cd my-project
2. Open VS Code (optional)
code . # opens current folder in VS Code
3. Initialize Git
git init
4. Add project files
Create or move files (e.g., [Link]) into the folder.
Then stage them:
git add .
5. Commit the files
git commit -m "Initial commit"
6. Create a new GitHub repo
Go to [Link] enter the repo name (e.g., my-project), and click Create repository.
7. Connect local repo to GitHub
git remote add origin [Link]
8. Rename default branch to main
git branch -M main
9. Push to GitHub
git push -u origin main
🧠 Final Command Summary:
cd ~/Desktop
mkdir my-project
cd my-project
code .
git init
git add .
git commit -m "Initial commit"
git remote add origin [Link]
git branch -M main
git push -u origin main