git hub visualstudiocode

Post on 21-Feb-2017

159 Views

Category:

Education

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Git & Visual Studio Code

Youth Techclub 06.04.2016

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?

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

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.

Git distribution Remote Local

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

You can branches both locally and remotely.

File status lifecycle in Git

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

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

Branches and commits

Workflow in Git

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

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 )

GitHub registrationwww.github.com

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

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.

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!

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.

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

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

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?

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

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

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

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?

top related