0% found this document useful (0 votes)
3 views3 pages

Git Hub

This document provides a step-by-step guide for initializing a Git repository and pushing it to GitHub. It includes commands for creating a project folder, adding files, committing changes, and connecting the local repository to a new GitHub repository. The final section summarizes the commands in a concise format for easy reference.

Uploaded by

helloworld01354
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

Git Hub

This document provides a step-by-step guide for initializing a Git repository and pushing it to GitHub. It includes commands for creating a project folder, adding files, committing changes, and connecting the local repository to a new GitHub repository. The final section summarizes the commands in a concise format for easy reference.

Uploaded by

helloworld01354
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

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

You might also like