Menu

Pushing Code to GitHub Repository

Pushing Code to GitHub Repository

First, create a new repository on GitHub. When you create a new repository on GitHub, you get the repository URL (e.g, https://github.com/Abhisesarcasm/Contact-Us-repo.git ) from the “Code” button on the repo page.

Then, run these commands in your terminal:

  • git init – Initializes a Git repository locally in your project folder.

  • git add . – Stage the README file (or any other files) to be committed.

  • git commit -m "first commit" – Commits the staged files with a message.

  • git branch -M main – Sets the main branch to main.

  • git remote add origin <your-repo-URL> – Links your local repo to the GitHub repository.

  • git push -u origin main – Pushes your local commits to GitHub.

GitHub Repo Link: Contact Us Repo