How to create commit and push content to a new Github repo?
To create a new repository on GitHub and push content to it from the command line, you will need to have Git installed on your computer. You can check if you already have Git installed by running the following command in your terminal:
If you don’t have Git installed, you can download it from the Git website.
To create a new repository on GitHub, follow these steps:
- Go to the GitHub website and log in to your account.
- Click the “New repository” button on the dashboard.
- Give your repository a name and a description, then click the “Create repository” button.
- Make note of the repository’s URL, which should be in the format
To push content to your new repository from the command line, follow these steps:
- Open a terminal and navigate to the local directory where you want to store the repository.
- Run the following command to initialize a new Git repository:
- Run the following command to add all of the files in the current directory to the repository:
git add .
- Run the following command to commit the files to the repository with a message:
git commit -m "Initial commit"
- Run the following command to add the remote repository as an origin for the local repository:
git remote add origin https://github.com/USERNAME/REPOSITORY_NAME.git
- Run the following command to push the local commits to the remote repository:
git push -u origin master
Your new repository should now be created on GitHub, and the files from your local repository should be pushed to it.