This presentation talks about simple git collaboration. First, it goes through the user interface of Gitlab, which we use at BECS to host our master repositories. We then talk a minimal process to clone (get a copy of) a repository there, edit it, and push changes back.

Remember, I can't teach you git. I can give you some ideas, and your curiosity will teach you. Also, there are a lot of other medium-advanced features which can really help you that I am not even talking about.

Before you come

Set up your git config file:

git config --global user.name "Your Name"
git config --global user.email your.name@aalto.fi
git config --global alias.log1 "log --oneline --graph --decorate"
git config --global core.editor nano            # You can set whatever editor you would like.

Here are some personal aliases you might like:

git config --global alias.cm "commit -v"
git config --global alias.di "diff"
git config --global alias.st "status"
git config --global alias.diw "diff --word-diff=color"

The Presentation

Outline

Gitlab

Gitlab features

Project #0: everyone log into gitlab and look around. Find the "complex networks" group and the "drvo" project.

git remotes

Reminder: common status commands

Below are the most common status commands.

Before and after everything you do, run these commands. It will provide you with feedback, and help a lot!

Our actual task: contributing to a project

Cloning (getting) a repository

Commands for sending/receiving code

Note: we found that amor has an older git version. On amor, do git rebase origin/master

Typical workflow

If someone else beats you to the push after your git fetch, then it'll fail again. In this tutorial, with everyone doing this at the same time, this may be a problem. You have to be fast!

Do interactive project #1 (at the bottom)

Conflicts

How to resolve conflicts

Conflict notes

Do interactive project #2 (at the bottom)

Optional: Merge vs rebase

Optional: stashing uncommitted changes

Conclusion

Remember: Commit early and commit often

If there is time, try interactive projects #3 and #4. These are optional.

Next steps

This section will have follow-up information later.

To discuss (eventually):

Projects

We'll do these projects together. Form groups of two (both people with computers). I made a sample tutorial.git project for us to play with.

Interactive project #1: basic usage

Interactive project #2: conflicts

Interactive project #3: merging

Interactive project #4: partial commit and stashing

CategoryTutorial

DebianNotes/git/GitlabAndCollaboration (last edited 2014-04-27 17:10:10 by RichardDarst)