an introduction – Git



an introduction – Git

0 0


preso-stash


On Github nexelem / preso-stash

an introduction

Created by Pawel Dolega / @pdolega

Need & reasons

Heads Up

Atlassian tagline

On-premises source code management for Git that's secure, fast, and enterprise grade. Create and manage repositories, set up fine-grained permissions, and collaborate on code – all with the flexibility of your servers.

Oh hey, these are some notes. They'll be hidden in your presentation, but you can see them if you open the speaker notes window (hit 's' on your keyboard).

Git

Branching

branch checkout merge rebase reset

Cloning

Workflows

Centralized workflow

Feature branch workflow

Gitflow workflow

Forking workflow / PR

more...

Basically you can mix & combine & create your own

Rule of thumb

The further you go from intensive development towards production and support the more complex branching model becomes

Problems

How to keep stable line while developing new feats possibly intertwined with critical bugfixes

More problems

How to make sure that all changes before reaching main line are:

  • reviewed
  • verified
  • compilable & unit-tested

Even more problems

How to avoid putting burden of resolving conflicts on single person (aka. lieutenant )

Stash / Github / Bitbucket

.. vs Git

  • Most of the time you work as before

Fork

~ server-side clone

Diff

Shows differences between branches* possibly between forks

Pull changes from one fork to the other

Or in general from one branch to the other * doesn't really matter if branches are on the same fork or not

Process

fork clone remotes

Process

// clone your fork
git clone https://test@stash.nexelem.com/scm/~test/test.git

// add upstream (main repo)
git remote add upstream https://test@stash.nexelem.com/scm/test/test.git

// create your feature branch
git branch new_feat
git checkout new_feat
git push --set-upstream origin new_feat

// .... work (add, commit, etc)
git push origin new_feat

Process

... the rest is as it's always been (commit, push, fetch, merge, rebase)

But one difference !

You never push to main repo. You only push to your fork.

Pull request ( ! )

So what is Stash

Basically on-premise Github / Bitbucket (more of the latter)

Demo 1

Overview, browsing repos, forks, code, commits

Working with stash - key points

  • open PR right away and start pushing changes
  • don't worry about pushing things that are not ready

Demo 2

Committing code, merging, PR, collaboration

Collaboration

Whatever seems to be interesting

Future enhancements

  • Build PRs (compile, unit-test, verify)
  • Redeploy server from PRs

Links

THE END

by Pawel Dolega