Git code versioning

Git code versioning
0
#1

Hi

I am confused about git and github and also how it works. What are dependency files? files like yaml, pom what they do?

Please let me know about it in very simple way.

#2

These have absolutely nothing to do with GitHub.

Dependency files are text files used by specific language and/or framework build tools (ie the tools used to take source code and generate executable code). They list the dependencies needed for the project to build. Like a .pom file is a[n XML file] used by the Java build tool Maven. They don’t do anything on their own, they’re just a list of things a project in that language needs. The build tool reads and does whatever it does with that list of things.

YAML is a version of JSON (which is one way of formatting a text file to make it easy for a computer to read or write and extract data from). It’s often used to write configuration files for software/frameworks/etc (eg a list of settings that a specific thing will use)


Git is a piece of software designed for developing software: it is a version control system. Think of it like a “save” command.

You make some changes to some code. You then “commit” those changes (like saving them). You make some more changes. You commit those. You realise you made a mistake, you can go back to the first commit and the code will revert back to that.

You decide you want to experiment a bit, so you “branch” your code. There are now two branches: the original code, which you can revert back to at any time, and your new branch, which you can experiment with as much as you want. Nothing will happen to the original code, you can completely mess up your experimental branch and nothing bad will happen.

Your experiment is a success! You can now take your branch and merge it back into the original codebase and release the code with your additional code included.


The reason it is so powerful is that it doesn’t matter how many people are working on the same code base at the same time: they each have their own version, and they can make their own branches and commit their own code and it can all be kept in sync. It allows multiple developers to work on a single codebase at the same time without destroying anything. And it provides a complete and [hopefully] infallible history of all work on a code base (it works the in the same as blockchains).


It is useful to have one central place where all the code lives, then all the people working on it have a central point they can pull code down to and commit code and push it back up to. That’s what GitHub is for.

GitHub is not necessary to use git, it just makes the process much more visible if there is a central place for code to live. And there are other alternatives as well, other git-based code repositories — Bitbucket and GitLab are the two main competitors.

2 Likes