Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Need help understanding how to use Stash / Git

Dalbar IT November 27, 2012

Hi,

I'm new to Stash, Git, and have limited experience with source code control. I installed Stash and Git on a server. I was able to add a Git repository for one of my existing projects, then clone that repository to Stash. So I think everything's working right, I'm just having a little trouble understanding conceptually how I should use everything. Right now I have a ton of source code with no control.

For example, if I want to work on one of my projects on my pc, and I've created a repository on my source code on the network, do I clone it to my pc, then clone it back to the network when I'm done, then clone it to Stash? Or should the entire repository be just in Stash, then I would clone it to my pc and back to Stash when I'm done?

I don't have a great understanding of how to use Git yet, but I wanted to have a more high level understanding of what I should be doing first. The existing documentation that I've found doesn't really answer what I'm looking for. Can anyone point me in the right direction or give me some ideas?

Thanks,

Scott

1 answer

1 accepted

3 votes
Answer accepted
Colin Goudie
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 27, 2012

You've asked a big question for sure :) I think you're primary goal initially should just be to get comfortable using source control and not worry to much about Stash

Git is a bit of a beast to learn especially if you have never used source control (Although I guess it could be argued that it may help to come in with a new perspective )

In terms of 'cloning' though

Git is a DVCS (Distributed Version Control System) so technically there is no 'master' repository except that which you yourself view as master as a convention. In this case, this would be Stash

Whenever you 'clone' a git repository you will end up with a FULL repository including ALL history. So when you clone from stash to your dev machine, you now have a full repository on your machine. If e.g., you have a build server, it too will end up with a full copy (there are ways to limit this but not important here)

In everyday work you will have first cloned to your dev machine (that's it, you don't clone again)

Then you make mods during the day and 'commit' those changes back to your local dev repository. You can keep working, commit, work, commit and then at some suitable time - 'push' those changes back to the Stash git repository. This means now that any other people working on the same project can 'pull' from Stash and get your changes.

But you need to get comfortable using git. You could even just use git to commit locally and never push, but just get used to using git's commands to commit, rollback, view history etc..

Maybe start searching google for git howtos as well - http://learn.github.com/p/intro.html

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events