01 logo

Git Goin on Design!

How Git and Github can back up your projects

By Laura GiegPublished 5 years ago 3 min read
Like
Terminal screen, showing command line

Git? What’s that? Version control... well, that doesn’t mean much to me. Wait, I can backup my projects with it? Excellent! THAT makes it useful! And helps me work with other developers on a code project without overwriting any of their parts—now we’re getting somewhere. So how do I do that? Apparently, there’s a tool called terminal native to a computer’s operating system—hmmm, *think* I’ve come across that before. Let’s see... Applications/Utilities/Terminal (apologies, Microsoft folks, using a Macintosh, so no idea where Terminal would be on your computers). So, time to fire up Terminal and take it for a test drive!

Sooo... Terminal opened, now what do I do? Hmm, so Git - -version will tell me if I have it already or not; Git-scm.com gets me either Git if I don’t have it or an update if I do. Wonderful, now I can play with it. Alrighty, so… now I need to configure the Git environment if it’s a new install; Git config user.name for username, Git config user.email for e-mail—straight forward enough. And there we go—all set up! Now I can actually *use* it. So, navigate to the folder where you want your repository, and then create repository in the command line of your terminal: Git init... I assume that means initialize repository; Git status tells you what files in the folder are available to add to the repository. To add files to the folder: first Git add and the file name, and then Git commit -m “Message you want to leave.” Git status will tell you where you are in the repository process, or you can Git log to see a history of commands that you’ve entered into the command line in terminal. Git is built like a tree, so you create branches off the main code and then merge them with that code when you’re done. So, to make a change to your base code, enter Git branch into the command line; now you can make the changes you want on your code (say maybe you want to change your white background to grey), and then Git merge to merge it back into the main code. To create the branch and switch to it you input git checkout -b branchname... that makes sure you’re in the right code to begin with. Git checkout master sends you back to the main code; still with me? Now to merge: Git merge branchname; we’ve now taken care of making a local repository, but we still need a remote repository, right? To both keep us from losing all the work we did as well as to have it available to other members on the team if we’re working on said project as part of a group.

Enter Github, where remote repositories are stored. So, over to Github.com to sign up... don’t you just love how you have to sign up for everything? Anyway, username, e-mail, password—all the usual stuff. For creating remote repositories, you can either use https protocol or ssh protocol; recommended protocol is the ssh, as it’s more secure. Ssh is a pair of keys, one private and one public, that verifies your identity.

New repository (green button on your Github dashboard) creates a new repository. If you want to find out if you have any remote repositories connected to your local one, Git remote -v; Git remote add origin [email protected]:your-username/local-git-repository.git. Now we need to push the files to Github: Git Push -u origin master. (I’ve covered most but not all material in this module of Skillcrush Tech Blueprint—there is a lot to cover (information taken from the Skillcrush Tech Blueprint website and paraphrased).

how to
Like

About the Creator

Laura Gieg

Website, brand, graphic, and visual designer-in-learning, gamer, 3D modeller-in-learning... yeah, I like designing... also writing comics to preface a game I’m also designing. You should hopefully see the writing side of me quite a bit.

Reader insights

Be the first to share your insights about this piece.

How does it work?

Add your insights

Comments

There are no comments for this story

Be the first to respond and start the conversation.

Sign in to comment

    Find us on social media

    Miscellaneous links

    • Explore
    • Contact
    • Privacy Policy
    • Terms of Use
    • Support

    © 2024 Creatd, Inc. All Rights Reserved.