eli5 GitHub/Gitkraken basics

221 views

I signed up for a college class thinking I’d be writing storylines for video games, but it is NOT that. So, I’m doing GitHub stuff and I am so confused.

I did a computer science fundamentals class last semester thinking it would be fun; it wasn’t. Technology is like magic mumbo jumbo and I cannot get a handle on it. Anyway, there are no other classes for summer I’m interested in, and I want to keep the credit hours I’ve signed up for.

What is a repository?
Commit?
Staging?
How does any of this work with coding? Or creating something?

And yes, I’ve watched the tutorials but I just don’t what these basics mean, and the videos just act like I should.

In: 9

7 Answers

Anonymous 0 Comments

Imagine you and a friend are working on a project that involves a lot of files. This project has text documents, spreadsheets, images, all kinds of stuff. The two of you need to be able to make changes to this complicated mess while also making sure you’re not overwriting the work the other person is doing. So you agree on the following system

There will be a master version of all the files, separate from the versions either of you have on your computers

The two of you, and anyone else you might bring on board, can go get a copy of this master version

Now that you have a copy, you can make changes to the files. When you’re satisfied with your changes, you can bundle them up, maybe write a little note about why these changes were made

Then you can send your bundle of changes to the master version.

If you and your friend both send bundles, and the files you were working on were different then the ones your friend was working on, no problem. The master version can apply your changes easily.

But if you both made changes to the same file, uh oh! The master version will accept the first bundle submitted, and then reject the second. It will tell that person “Hey, you need to get a new copy of the master version, look at the other person’s change, and resolve the discrepancy.” Hopefully it’s a non problem; maybe you edited a document’s title, and your friend edited the font size. Those charges don’t conflict. But maybe you both edited the title. Now, the rejected person needs to do some work to resolve the problem. They need to make a decision about what the real charge to the title should be.

Once they fix the conflict, they can resubmit the bundle, and the master version can be confident that this change takes the other person’s work into account.

If that makes sense, that’s git.
The master version is a repository
Getting a copy of the master version is called cloning.
A bundle of changes is a commit. If you’ve made changes to many files, but don’t want to commit all of them, you can stage just the ones you’re ready to send.
Sending the bundle to the master is a push.
Trying to push a file that’s already been changed by someone else is a merge conflict.
Getting the changes that are in the master but not in your local copy is called a pull.

GitKraken is just a UI so you can do all this without typing out commands. It also tries to help you visualize all the changes and contributors to a project, but honestly I don’t find the graph very helpful

There’s a ton more, but don’t sweat it. If you can understand git as a record of all the changes made by all the people working on a project, you’re 90% of the way there

You are viewing 1 out of 7 answers, click here to view all answers.