git hub party-20151008

66
GITHUB PARTY! Thursday, 8 October, 2015 Savoir Faire Linux, Montreal https://www.savoirfairelinux.com/

Upload: blanca-mancilla

Post on 13-Apr-2017

208 views

Category:

Technology


0 download

TRANSCRIPT

GITHUB PARTY!Thursday, 8 October, 2015

Savoir Faire Linux, Montrealhttps://www.savoirfairelinux.com/

GITHUB PARTY| Françoise Provencher francoiseprovencher

INTRODUCTIONLink to .Finding a project to collaborate in

the presentation

https://github.com/explorehttps://github.com/showcases

PARTS0. 1. 2. 3. 4. 5.

IntroductionBare BasicsSharingCollaboratingYour turnWhat is next?

Do you have your account already?

PART 0https://github.com/

Git is a free and open source distributed version controlsystem designed to handle everything from small to very

large projects with speed and efficiency.

GIT

https://git-scm.com/

Git is a widely used version control system for softwaredevelopment. It is a distributed revision control systemwith an emphasis on speed, data integrity, and support

for distributed, non-linear workflows.

GIT

https://en.wikipedia.org/wiki/Git

GITMore technical definition and to really understand Git:

Setting up Git:

https://git-scm.com/book/en/v2/Getting-Started-Git-Basics

https://help.github.com/articles/set-up-git/

GITHUBGitHub is a Web-based Git repository hosting service. It

offers a lot of the functionality of Git as well as adding itsown features.

https://en.wikipedia.org/wiki/GitHub

PART IRepositoriesForksIssuesBranchesLocal changesCommits

A repository is the basic unit of GitHub, most commonlya single project. Repositories can contain folders andfiles, including images – anything your project needs.

REPOSITORIES

REPOSITORIEShttps://github.com/bluciam/helloworld_pyladiesMTL

PART IForksIssuesBranchesLocal changesCommits

Repositories

A fork is a copy of a repository. Forking a repositoryallows you to freely experiment with changes without

affecting the original project.

FORKS

Most commonly, forks are used to either proposechanges to someone else's project or to use someone

else's project as a starting point for your own idea.

FORKSLET'S CREATE A FORK

1. Login into your GitHub account.2. Head over to

3. Find the Fork tab and click on it.https://github.com/bluciam/helloworld_pyladiesMTL

Full instructions with commands for local repository:

FORKS

https://help.github.com/articles/fork-a-repo/

FORKSSynchronizing your fork with the master repository.

There are two ways:

Making a pull-request into your own repository.Using the command line.

PART IIssuesBranchesLocal changesCommits

RepositoriesForks

ISSUESAn Issue is a note on a repository about something thatneeds attention. It could be a bug, a feature request, a

question or lots of other things.

PyLadies Montreal needs a logo!

ISSUESLET'S CREATE AN ISSUE

https://github.com/bluciam/helloworld_pyladiesMTL

ISSUESYOUR TURN!

Click on the issues link, to the right.

Click on New Issue.

Go Wild! Create! Comment!

https://github.com/bluciam/helloworld_pyladiesMTL

PART I

BranchesLocal changesCommits

RepositoriesForksIssues

Branching is the way to work on different parts of arepository at one time.

BRANCHES

BRANCHESLET'S CREATE A BRANCH

1. Head over to

2. Find the Branch: master tab and click on it.

3. Enter the name of the new branch: translate-README.

https://github.com/<your-github-handle>/helloworld_pyladiesMTL

Full instructions at

BRANCHES

https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/

PART I

Local changesCommits

RepositoriesIssuesForksBranches

MAKE A CHANGECHANGE IS GOOD!

CHANGE BRINGS HAPPINESS!

1. Head over to

2. Click on the issues link.

3. Choose an issue.

https://github.com/bluciam/helloworld_pyladiesMTL

MAKE A CHANGELET'S DO IT!

1. Head over to your own account.

2. Choose the branch you want to make the change in.3. You can either add a file or modify an existing one.4. Go wild!

https://github.com/<your-github-handle>/helloworld_pyladiesMTL

Changes to a file can be done by clicking on the pencilicon in the upper right corner.

Add a file by clicking on the plus sign after the directoryname.

MAKE A CHANGELET'S DO IT!

MAKE A CHANGEMake a change in the master branch.And in another branch.In the same line.Commit the changes separately.

PART I

Commits

RepositoriesIssuesForksBranchesLocal changes

Commits are the heart of git and GitHub. They are thesaved changes on the repository.

COMMIT YOUR CHANGES

Each commit should have a message:

1. Think that you are writing an email to a futurecontributor who will read this five years from now.

2. Explain why the change.3. Remeber that git can already answer who, when and

what, so no need to add these.

COMMIT YOUR CHANGESMake your changes.Add a one-liner summarizing the change.Add a summary of the change.Click on the Commit changes button.That's it!

Commit messages form a story of the project.

PART IRepositoriesIssuesForksBranchesLocal changesCommits

BREATHE!SMILE!

PART 2Sharing changes!

Pull requestComparing differencesBlameSynching your fork

Pull Requests are the heart of collaboration on GitHub.When you make a pull request, you’re proposing your

changes and requesting that someone pull in yourcontribution - aka merge them into their branch.

PULL REQUEST

As soon as you make a change, you can open a PullRequest. People use Pull Requests to start a discussionabout commits (code review) even before the code is

finished. This way you can get feedback as you go or helpwhen you’re stuck.

PULL REQUEST

PULL REQUESTLET'S CREATE A PULL REQUEST

1.

2. Find the link to Pull Request on the right.3. Click on it.4. Click on the New pull request button.5. Click on Create pull request.

https://github.com/<your-github-handle>/helloworld_pyladiesMTL

You are presented with a screen to enter a message andto choose which branch to ask the request on, if there

are many choices.

Instructions at

PULL REQUEST

https://help.github.com/articles/creating-a-pull-request/

The best is to see it in action...

PULL REQUESTLET'S SEE IT!

PART 2Comparing differencesBlameSynching your fork

Pull request

It is another way to get to a Pull Request.

COMPARING CHANGES

COMPARING CHANGES1. Head over to your own account.

2. Find the green button at the top next to the Branchbutton. That will show you directly the differencesbetween the main repository and your local changes.

https://github.com/<your-github-handle>/helloworld_pyladiesMTL

Again, the best is to see it in action...

COMPARING CHANGESLET'S SEE IT!

Click on the number next to the fork button to see thenetwork graph.

COMPARING CHANGES

PART 2BlameSynching your fork

Pull requestComparing differences

BLAMEThe blame command is a Git feature, designed to help

you determine who made changes to a file.

Despite its negative-sounding name, git blame isactually pretty innocuous; its primary function is to pointout who changed which lines in a file, and why. It can be

a useful tool to identify changes in your code.

Instructions at

BLAME

https://help.github.com/articles/using-git-blame-to-trace-changes-in-a-file/

PART 2

Synching your fork

Pull requestComparing differencesBlame

SYNCHING YOUR FORKClick on the compare button.

Click on Compare across forks.Choose the branches that are difference.

PART 2Pull requestComparing differencesBlameSynching your fork

BREATHE!SMILE!

PART 3Collaboration!

Create a repositoryAdd collaboratorsBe Social

CREATE A REPOSITORYWe are going to create a super heroine project!We will call it super-heroines-pyladiesMTL.Let's do it!

PART 3Add collaboratorsBe Social

Create a repository

ADD COLLABORATORShttps://help.github.com/articles/adding-collaborators-to-

a-personal-repository/

PART 3Be Social

Create a repositoryAdd collaborators

BE SOCIALhttps://help.github.com/articles/be-social/

PART 3Create a repositoryAdd collaboratorsBe Social

PART 4Your turn!

Create your own repositoryIdeas:

Python tutorial exercisesYour thesisTalksYour CVYour coding project

WHAT IS NEXT?

WHAT IS NEXT?Interaction between the git command line and github,

that is, your local repository and repo in the cloud.