My name is Mason Ellwood, and I’m currently working on Flatiron School’s Online Full Stack Web Development Program. Each week, I’ll be writing about my experience, what I’m learning, and tips on learning to code.
So creating and associating local and remote repositories through GIT and GitHub can be a little tricky. First, you would need to create your files that you would like to merge with a repo.
Here I have set up an empty folder. Next inside of the terminal navigates to the file folder you have created.
Next, what you would like to do is navigate to GitHub. If you haven’t already, go ahead and create a new account. Once finished, create a new project and name it appropriately. Once done, click create a repository.
Once clicked you should see the screen below.
Under the “…or create a new repository on the command line” option click the copy to clipboard option. Then navigate back to your terminal
In your terminal past, the code copied to your click board. It should look something like this.
Awesome! Now you are able to update local code and push and pull to your remote repository through your command line.
To double check that this was, in fact, working the way I wanted it to, I created a new Ruby file in the folder that was linked to the remote repo. I then added it to the local repo using (git add .), which adds all updated files to the local master branch and added a message to that using (git commit -m “added Ruby file”). I then pushed my new changes to GitHub through command line using (git push -u origin master), which adds changes to the master branch in Github.
As you can see the changes took effect and now we have our new something.rb file uploaded to Github, now accessible from anywhere.
Let me know if you have any questions, and thank you for your time.
Leave a Reply