git hub visualstudiocode

24
Git & Visual Studio Code Youth Techclub 06.04.2016

Upload: rolands-krumbergs

Post on 21-Feb-2017

167 views

Category:

Education


0 download

TRANSCRIPT

Page 1: Git hub visualstudiocode

Git & Visual Studio Code

Youth Techclub 06.04.2016

Page 2: Git hub visualstudiocode

ContentWhat is Git? Why do we need it?What are the core principles behind Git?What is GitHub and how to work with it?What is Visual Studio Code and how it integrates with GitHub?How to work with Visual Studio Code extentions?

Page 3: Git hub visualstudiocode

AgendaOverview of Git and principles behind itDemo of main Git commandsOverview of GitHubDemo of main functionality in GitHubDemo of Visual Studio CodeTask

Page 4: Git hub visualstudiocode

What us Git?Free and open source distributed version control system.

Popular with open source projects.

Allows us to create local repositories based on remote repository and later on push changes from local to remote.

Page 5: Git hub visualstudiocode

Git distribution Remote Local

Page 6: Git hub visualstudiocode

Some basic Git terminologyBranch – a specific version of codeMaster branch – initial branch in repository

You can branches both locally and remotely.

Page 7: Git hub visualstudiocode

File status lifecycle in Git

Page 8: Git hub visualstudiocode

File status in actiongit init – creates a repository in foldergit status – checks the current status of repositorygit add – adds file to repository, stages the changesgit commit – commits changes in the branch

Comments:- Each commit is identified by hash number- .git folder contains configuration information about

repository

Page 9: Git hub visualstudiocode

More on branchinggit branch <branchname> - creates a new local branchgit checkout <brachname> - makes the specified branch as active

Page 10: Git hub visualstudiocode

Branches and commits

Page 11: Git hub visualstudiocode

Workflow in Git

Page 12: Git hub visualstudiocode

More commandsgit push – pushes all commits to the remote branchgit fetch - check how far behind local branch isgit pull – take all commits that are in the remote branchgit checkout – checkout specific branch in local repositorygit merge – merge changes from one branch into another one

P.S. We will check these when we set up GitHub

Page 13: Git hub visualstudiocode

GitHubWeb-based Git repository hosting service.

Communities can host open source projects.

You can search for projects to participate.

Private repositories are possible (of course, you will have to pay for them )

Page 14: Git hub visualstudiocode

GitHub registrationwww.github.com

Use university email to register with GitHub education pack to get private repositories too.

Page 15: Git hub visualstudiocode

DemoCreate a new empty repository.

Add created repository as a remote for local repository.

Edit file again, do a commit – see that nothing happens in the remote.

Push changes to remote branch.

Page 16: Git hub visualstudiocode

Visual Studio CodeAdvanced code editor (similar – Sublime, Atom)

Open source, free, by Microsoft

A lot of extensions – code snippets, language support

Integrates with GitHub

P.S. Totally not the same as Visual Studio IDE!

Page 17: Git hub visualstudiocode

Personal experienceStarted to work a lot with Team Foundation Server (centralized version control system).

Currently working only with Git as it is much easier to work on multiple features and allows code review policy enforced with pull requests.

Page 18: Git hub visualstudiocode

Demo1. Create an empty folder, open it in Visual Studio Code2. Create a new text file and add some text there3. Initialize new Git repository through Visual Studio Code4. Commit changes

Page 19: Git hub visualstudiocode

TaskPart IFind Youth Techclub in GitHub un fork web siteDo some minor changes and create a pull requestPart IICreate repository for own projectCreate initial index.html and basic folder structure in local repository and push code to GitHub

Page 20: Git hub visualstudiocode

Task (2)Part IIICreate a repository in the GitHub and put code to it (or use already created one).Add a new member (that sits next to you) as a contributor and be a contributor in some repository.One contributor in repository must create 2 commits, second one also must create 2 commits. Both contributors must push commits to remote. What happens?

Page 21: Git hub visualstudiocode

Task (3)Part IVOpen folder created in Part II in Visual Studio Code.Set up possiblity to push code to remote.Set up storing credentials for Git in global store.

P.S. You will need Google for this

Page 22: Git hub visualstudiocode

What is next?Date Focused onTBD * Typescript basicsTBD Angular 2 basics & project developmentTBD Project developmentTBD Project developmentTBD NodeJS basics & project development

* In about two weeks

Page 23: Git hub visualstudiocode

Next meetupsClosed for people who have participated in at least one open meetup.

Same structure:- First some theory and demo- After that tasks to move the project forward

Expect to do a lot of Javascript

Page 24: Git hub visualstudiocode

Just a reminderwww.meetup.com -> great place to follow Youth Techclub

Your feedback about 3 open meetups is welcomed:- 3 things that you did not like- 3 things that you really liked- What should we improve?- Any suggestions?