What do these words mean in Git / GitHub: fork, clone, track?

10

I have just started using Git and until this week I only used the Visual Studio interface. After several problems with Git through the interface, I started solving some things on the console, so now I'm really having to learn Git. I find several sources telling me commands to solve my problems, but few places really explain those terms that I see everywhere.

    
asked by anonymous 29.07.2016 / 20:26

1 answer

21

Repository

Repository is the place where your files are stored with commits, branchs, etc. Anything about git will be in this folder, usually called .git which is the repository.

Fork

Explaining with my words, it would be like a curve you make and pick up the files to edit them and then upload them to the repository. In Github when you click fork in someone's repository, it takes the whole repository of that person and copies it to your git account, there you can edit those files and then return that person with your edits, if the person accepts, their changes also enter their repository.

Branch

It's ramifications you make for when you're developing new features. When you start git init you have a default branch that is master . When working as a team, avoid developing in the master branch as it can lead to many conflicts. Always create a branch to make your modifications. For example, you will develop a new functionality to list database clients and edit, you could create a new branch called clients and work on that branch to then play the master

clone

As the word itself is a clone . This command is for you to clone repositories of another person. In github you can clone repositories by typing in the console of your operating system git clone URL_RE_REPOSITORIO

track

I think here you talk about the untrack files area . When you start git and soon after that you start editing files in that folder you started git or it also puts new files so it looks like untrack files (non-tracked files) that are not " "by git, that is, they are not yet in the .git folder or that are and have been modified. When you give a git add or git add file.extension it goes to track files which means that git is looking but not yet is in the git repository. Only after you commit the git commit -m "commit description" does it leave that area and fully enter the git repository.

I do not know if you understood very well, but I tried to explain it with my words. Here's a link to getting started with git

# 1 Getting Started with Git

# 2 Git Basic Commands

    
29.07.2016 / 20:40