Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Create Git Repository and Push Your Code to it 👨‍💻️

So you are a coding Bootcamp student and you need to push your local code to a repository on your GitHub account. I assume you have a GitHub account and have it set up already. If not, that’s OK. Here is a link to how to do that: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

Well, let’s get started.

Step 1) Create Repository

Login into GitHub and create a repository

Create repo screenshot

You can do so by either clickin the green button on the left (once you have logged in) or the drop down box with the ‘+’ symbol at the top right.

Step 2) Specify Repository Options

Name your repository and do not check any of the checkboxes. Keep your name short and simple and apply the same naming every-time you create a new repository or folder/files for that matter.

Step 3) Run Commands in Terminal

Open up a terminal. CD (change directory) into the directory where you have your code. Don’t do this in the wrong directory. Bad things happen when you do! Once you are in the right directory run the following commands. For the second command use a dot (.)

You can replace first commit message with anything that describes why you are pushing this change up to your Repo. Although there is a 99.99% chance first commit is appropriate.

git init

git add .

git commit -m "first commit"

git branch -M main

git remote add origin

git push -u origin main

Step 3) Announce Your Win

The last step is to slack your group and let them know you are done

The post Create Git Repository and Push Your Code to it 👨‍💻️ appeared first on Coding Tutor Blog.



This post first appeared on Coding Simplified, please read the originial post: here

Share the post

Create Git Repository and Push Your Code to it 👨‍💻️

×

Subscribe to Coding Simplified

Get updates delivered right to your inbox!

Thank you for your subscription

×