What is the relationship between Git and Stash?

Vinee-the-Pooh picture Vinee-the-Pooh · Aug 30, 2015 · Viewed 34.1k times · Source

I can access my company Stash project repositories. I cloned the project into my local Git repository through Eclipse IDE. For that, I installed required Git plugins into Eclipse.

My questions are:

  • Git is just a facilitator to communicate with Stash?
  • Can't we use Git as distributed repository instead of Stash?
  • What is the relationship between those two tools?
  • Without Git, can the code be cloned, committed to Stash? Or, without Git, can Stash exist?

Answer

wasabi picture wasabi · Aug 30, 2015

Some brief information about Stash and Git.

Git is a distributed version control system.

Stash is a repository management system of Atlassian. It can be used to manage Git repositories, also it can be used to manage repositories of other version control system like mercurial.

A good overview for each product can be found in their official sites;

Git official site, about page

Atlassian official site. In September 2015, Atlassian renamed their Stash product to Bitbucket Server.

There are many repository management system you can use with Git. One of the most popular is Stash in Enterprise world. But when you look to open source world, GitHub is the most popular one as far as I know.

You can create repository, push, or pull your code into Git repositories whether they are in your local computer or they are in remote corporate servers. Using a repository management system ( like Stash) for this kind of task is not necessary, but It is sometimes preferred, especially by the companies which has huge It departments.

So, Git, and Stash are not alternative but complementary to each other. You can think Git as a kernel and stash as the shell surrounding the kernel.

But, why we need repository management systems;

  1. Security; huge corporates wants to manage who can access which projects source file with what restrictions. Git can not handle this, it is just VCS.
  2. Administration; You can integrate with corporate LDAP system, You can manage user easier.
  3. Integration; You may have Jira for issue tracking, bamboo as build server and confuluence as wiki. And you can easily integrate them because all of them Atlassian's tools.
  4. Ease of use

Now, Lets try to answer your questions;

I can access my company Stash project repositories. I cloned the project into my local Git repository

Whether Code repository is on remote server behind stash or it is in local computer. It is a Git repository.

Git is just a facilitator to communicate with Stash?

No, Vice versa is more correct. Git is the core of VCS, you use stash to make it more manageable, secure, and easy to use in your corporate.

Can't we use Git as distributed repository instead of Stash?

First you can not use Git instead of Stash, because they are not alternative to each other. But they are complement to each other.

If you mean using Git as remote repository, sure you can use it.

For clarification, Git is distributed not because you can have remote repositories. Whether centralized or distributed, you can have remote repository on all VCS. Distributed means, when you clone a repository, you also clone all history etc. In this structure, you can have a central repository but it is not required. If centrol repository get corrupted, it is not a big deal, any node can become new central repository. Even though in corporate world having a central repository is best practice, some open source projects ( for instance Linux kernel) don't have a central repository.

What is the relationship between those two tools?

I think it is already explained above. They are complementary to each other. Git is the VCS, and stash is repository management tool. It makes Git more secure and manageable for corporate IT departments.

Without Git, can the code be cloned, committed to Stash? Or, without Git, can Stash exist?

It is already explained as well. You can use Stash with other VCS. Git is not necessary. But you need at least one VCS.

You can not commit/clone code to/from stash. You can commit/clone code to/from VCS via stash.

VCS: Version Control System