Using Git Terminal to update Source Control

Here’s another note to myself, as well as for others who may just be using Git through the terminal for the first time.

Git is the original source control of Github Desktop application, except that it makes you look a lot like a hacker when you’re using it. Oh, and Pull & Push makes more sense now: You PUSH your changes into the master branch, and you PULL your changes from the master branch into your local repo.

Let’s say that you modified your project slightly on your project, and you’re wanting to commit it, merge it and push it into the master.

  1. Open Terminal.
  2. Get to your destination. In this particular project, I need to get into where my project was saved, and where Terminal is referring to this project from. Documents -> Beachcomber -> Beachcomber. I can do this by typing into terminal:Screen Shot 2018-11-01 at 6.25.55 PMcd documents” ->  “cd beachcomber” -> “cd beachcomber
  3. Type “git status” to check out what’s going on in your current project.Screen Shot 2018-11-01 at 6.28.52 PM.png
  4. Whoa! That’s a lot of red. But don’t worry! That means that your changes are simply not yet committed yet. The instruction says to type “git add file” to update what I want to be committed, and “git rm file” to remove what I don’t want to be committed.Screen Shot 2018-11-01 at 6.30.06 PM.png
  5. Here is a quick tip for committing these files. By using the “*” star, you can include all files that share similar names. Right now, I see a lot of Beachcomber_WwiseProject/GeneratedSoundBanks… files. Even though they’re all ending in different file formats, a lot of them share the same name up to that point. So I can type in “git add Beachcomber_WwiseProject/GeneratedSoundBanks/*” Notice the star at the end there. It’s very important and will save you lots of time. BEWARE though, if you’re adding or removing files, using * will add or remove ALL files that share the same naming convention, and might accidentally add or remove files that you didn’t want. ALWAYS read over all of the files before using the *.
  6. You see all these .meta files? They are generated but don’t necessarily need to go into your master branch. Simply ignore them. Don’t try to remove them.Screen Shot 2018-11-01 at 6.43.35 PM
  7. Once you are done with your adds, type in “git commit -m “message”“. Make sure to type in the message, otherwise, you won’t be able to commit. Don’t forget the space between the -m and message.Screen Shot 2018-11-01 at 6.58.07 PM
  8. Now that you’ve committed, you’re ready to push out the changes into the master branch. Go ahead and type “git push”. When you do it, the terminal will ask you for an RSA key. Your programmer should know this. Type it in, and watch as you merge your stuff into the master branch.screenshot

And that’s it! You have successfully added your changes to the master branch.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s