Create Public Repository in GitHub and Commit README File on Mac - VicPhanDevOps/mac GitHub Wiki

• Go to https://github.com/ in a web browser and select “New.”
image

• Type desired repository name in the “Repository name *” box.
image

• Type a description in the “Description (optional)” box and select “Create repository.”
image

• The new repository will be created.
image

• Browse in the Finder to the directory you want the repository in and right-click the directory. Expand the “Services” menu and select “New Terminal at Folder.”
image

• Type mkdir < new repository > and press the return key to create a new directory for the new repository.
image

• Type cd < new repository > and press the return key to change directory into the new repository.
image

• Type echo “# < new repository >” >> README.md and press the return key to create the README.md file.
image

• Type git init and press the return key to initialize Git.
image

• Type git add README.md and press the return key to stage the README.md file.
image

• Type git commit -m “< commit message >” and press the return key to commit the change with a commit message.
image

• Type git branch -M main and press the return key to make the current branch the main branch.
image

• Type git add remote origin < new repository URL >.git and press the return key to add the new remote origin to your repository.
image

• Type git push -u origin main and press the return key to push changes up to GitHub.
image

• Return to the GitHub, refresh the browser and you will see the README.md in your new repository. • image

⚠️ **GitHub.com Fallback** ⚠️