What do these words mean in Git/Github: Fork, clone, track?

Asked

Viewed 20,057 times

16

It’s not long since I started using Git and until this week I only used it through the Visual Studio interface. After a lot of problems with Git for 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 these terms I see everywhere.

  • I think it’s been answered here, if I can locate it, I’ll paste her link.

  • 6
  • Fork is a feature of Git?

  • @diegofm the other question is about SVN. Are these terms generic for all versioning systems? Moreover it does not explain fork and track. Although I’m also not sure if this is Git or just Github.

  • By the definition I read in the Git and SVN questions, they have the same meaning yes, so I took it out of my question.

1 answer

27


Repository

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

Fork

Explaining in my words, it would be like a curve that you make and take the files to edit them and then go up in the repository. On Github when you click Fork in someone else’s repository, they take that person’s entire repository and copy it to their git account, there you can edit those files and then return it to that person with your edits, if they accept, your changes also enter their repository.

Branch

It is branches that you make for when you have developing new features. When you start the git init you have a default branch that is the master. When working as a team avoid developing in the branch master because it can give 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 customers and work on that branch and then play master

clone

As the word itself says it is a clone. This command is for you to clone someone else’s repositories. On github you can clone repositories by typing into console of your operating system git clone URL_DO_REPOSITORIO

track

I believe here you speak of the area of untrack files. When you start git and right after that you start editing files in that folder that you started git or also put new files then it looks like untrack files (not trackeados files) which is not "watched" by git, i.e., which are not yet in the folder .git or that are and have been modified. When you give a git add . or git add file.extension he enters the track files which means git is looking but is not yet in the git repository. Only after you git commit -m "commit description" is that it leaves this area and fully enters the git repository.

I don’t know if I understood it very well, but I tried to explain it in my own words. Here is a link to the first steps on git

#1 Getting Started with Git

#2 Basic Git commands

  • 1

    The track is in the branch context. It seems that all git clone creates a remote-tracking branches. And there’s the argument --track for several Git commands.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.