Using GitHub and GitLab

Andy Balaam
artificialworlds.net/blog

Contents

Getting the code

To get a copy of the code (but not be set up for contributing back yet):

Getting the code

Getting the code

To get a copy of the code (but not be set up for contributing back yet):

Getting the code

Getting the code

To get a copy of the code (but not be set up for contributing back yet):

git clone https://github.com/andybalaam/rabbit-escape.git

Making your own project

To make a new project:

Making your own project

To make a new project:

Making your own project

Making your own project

To make a new project:

Making your own project

Making your own project

git clone git@github.com:andybalaam/rabbit-escape.git

Making your own project

git push origin master

Making your own project

Making your own project

Making your own project

Side note

Side note

Side note

Contributing

Forking

Forking

Forking

git clone git@github.com:MY_USERNAME/rabbit-escape.git

Forking

Making a Merge Request

Making a Merge Request

git branch fix-bug
git checkout fix-bug
git commit -a -m "Bug fix part 1"
git commit -a -m "Bug fix part 2"

Making a Merge Request

Making a Merge Request

git push origin fix-bug

Making a Merge Request

Making a Merge Request

Making a Merge Request

Wait

Making a Merge Request

Making a Merge Request

Done!

Unless...

Improving a Merge Request

Improving a Merge Request

Improving a Merge Request

git commit --amend
git rebase -i master
git reset HEAD^
git commit

Improving a Merge Request

git push -f origin fix-bug

Improving a Merge Request

Improving a Merge Request

Done!

Unless...

Keeping in sync

Keeping in sync

Keeping in sync

git remote add upstream https://github.com/THEIR_USERNAME/rabbit-escape.git

Keeping in sync

git checkout master

# Should succeed if you have not committed onto master:
git pull --ff-only upstream master   
                           
# Otherwise:
git pull --rebase upstream master   

Keeping in sync

Keeping in sync

git checkout fix-bug
git rebase master

Keeping in sync

Keeping in sync

# Make sure we are on fix-bug:
git checkout fix-bug

git push -f origin fix-bug

Keeping in sync

More info

Donate! patreon.com/andybalaam
Play! Rabbit Escape
Videos youtube.com/user/ajbalaam
Twitter @andybalaam
Blog artificialworlds.net/blog
Projects artificialworlds.net