Categories
Uncategorized

Git

A brief introduction to Git and how to create a GitHub repository.

Git and Git Hub

git is a software application that you can install onto the computer that automatically saves previous versions of code in something called a repository.

What is a repository? A place to store previous versions of files and updated versions of a project/collection of files.

GitHub is an online server that hosts repositories for free.
It is used as an industry standard and many employers will ask to view one’s GitHub projects as a portfolio of past works.

How to Create a GitHub Repository

• Create a repository on GitHub to host a new repository. If you are working on a pre-existing project, skip this step and begin with cloning (below).
• Clone the url of the repository from GitHub into your terminal. Make sure you’re inside of the folder you want the repo folder to be cloned to. Don’t clone within another git repo. Use the terminal command ls -a to double check that there are no other .git files in the folder.
        {in terminal, type: }     git clone https://github.com/infiniteloom/new_repo.git
• Edit or add whatever you want to the repo folder then when you’re done and ready to back it up/share…
• Add the files to a ‘staged’ status. At this point, the files can still be unstaged. Only add all if you are inside of the repo folder that you want to be pushed. Use terminal command git status to confirm that they were added.
        {in terminal, type: }     git add – – a                 #two minus signs before the a flag
        {in terminal, type: }    gid add .            # don’t forget the {space} before the {.}
• Commit the files. This means they are ready to uploaded. Don’t forget the quotes around your notes for what you’re committing.
       {in terminal, type: }     git commit –m “added baby yoda with cup”   
• Finally, you need to push the files to github to actually trigger the upload.
       {in terminal, type: }     git push       ##optionally, you can say…
        {in terminal, type: }     git push origin master
Check status
along the way will illustrate when something has been staged or nothing has been staged etc.
        {in terminal, type: }     git status         

LeaNakamura's avatar

By LeaNakamura

I'm a Brooklyn-based web development student, musician and textile artist originally from Maui, Hawaii.

Leave a comment

Design a site like this with WordPress.com
Get started