Skip to content

Latest commit

 

History

History
913 lines (455 loc) · 44.3 KB

test-yourself-answers.md

File metadata and controls

913 lines (455 loc) · 44.3 KB

Test Yourself: Answers

This is the file you'll use to add your answers to the Test Yourself exercise. You will add them via pull request.

Instructions

See the Web Development Basics project for details.

Keep your answers under 3 paragraphs. Replace the line that says Your Explanation Here! with your explanation and a link to your Github username. See the example below.

The .md extension on this file means it's a markdown file. You can just assume it's a text file with a bit of HTML-ish syntax. If you'd like to read up more on markdown, which can be converted to HTML so you can add images or videos, check out the documentation from Daring Fireball. You shouldn't have any problem copying the styles other people have used.

Example Answer

Example Question

An awesome explanation about why this thing is amazing in plain-english that anyone can understand. You know what's also awesome? Learning. And puppies.

Contributed by Erik Trautman

All About Web Developers

What does a Web Developer do?

A web developer's job is very hands-on, and can vary wildly from person to person. Generally, a web developer's job involves a lot of planning, building websites or web apps from the ground up, deploying them, and maintaining them by fixing bugs or optimizing the code.

In other words, a web developer plays the role of both an architect and handyman, but their work lives in the cloud.

Contributed by Daniel Au

What's the difference between web developers and web designers?

Web designers are focused on the artistic design and ux/ui of a website or web app, whereas developers are focused on how to build it, although there is some overlap between the two nowadays.

What's the difference between front end, back end, and full stack developers?

Front-end developers focus more on the actual webpage itself, how the site looks to the end user. Back-end devlopers focus on the server side code that runs the applicaiton, Usually they use programming languages like Python, Ruby, or Java. Full-Stack developers are responibile for both the front-end and back-end of the application.

Front-end developers are responsible for User Interaction. Back-end developers focus on storing, delivering, and generating data for the front end. A full-stackdeveloper does all of these things.

Contributed by Yilen Pan

What's the difference between static and dynamic web pages?

Dynamic webpages change depending on the user input and actions. Because of this they also require a more complicated server. Static web pages offer no dynamic changes and keep their content no matter the actions of the end-user.

Dynamic pages allows users to create, destroy, edit, and read data. The data persists even when the page is closed, unlike static pages which are reloaded each time a browser is refreshed.

Contributed by Yilen Pan

What's the best way to get help when you get stuck?

The best bet to get help when you are stuck is to use google! There are other fantastic resources but google will give you great access to all of them. a lot of times you will find your answer turning up on StackExchange.

Contributed by Nick Schwaderer

Where are the closest developer communities to you?

Montana Programmers is a great statewide organization that also has a lot of smaller meetups available from meetup.com. There is a weekly Ruby lunch in Missoula, Montana and several general programmer meetups and drinkups in the region.

Contributed by Nick Schwaderer

What online developer communities can you join?

Start with IRC channels, subreddits, and various meetup groups in your specific area.

Look at r/Programming or r/learnprogramming Contributed by Yilen Pan

Why is it better to use a developer-friendly text editor like Sublime Text than something oriented more towards word-processing like Microsoft Word?

I think the most important reason why developer-friendly text editors are better than Word, is that editors such as Text Wrangler and Sublime Text save files in a proper format for Web Servers and Browsers. MSWord along with other word-processing programs tend to add additional information to files that Web Servers and Browsers do not understand.

Additionally, developer-friendly editors have features such as Code Coloring, basic code-hinting, File and Directory Management, and can be customized to be easier on your eyes when staring at them for hours.

Contributed by Aaron Dressler

What are the top 3 characteristics of great web developers?

Curiosity/creativity - The passion for creating/building and the hunger for learning new technologies Ability to think quickly and problem solve - Figuring out a soluition to a problem construct on your feet and easily is a hallmark of a great developer Persistence - The developer world is fraught with obstacles and setbacks, but persistence will pave the way to success Contributed by Dondi Fusco

What do companies look for in a junior web developer?

Companies want developers who have built working code. They are looking for good portfolios which demonstrate talent and persistence. Passionate and committed developers who are able to communicate effectively and work on a team are in high demand.

Companies looking for Junior Web Developers are seeking people who are competent communicators, show a high level of effort, creativity, and willingness to learn new technologies and techniques.

Smaller companies usually need "the best specialist" even if it is only "junior". All juniors must be open-minded, quick to adapt and show yourself as hard working individual. And first-of-all you must show your work, even your toy projects.

It's best to provide any infromation which can give relevant answers to the tough questions: "Are you smart?" and "Can you code?"

Contributed by Aaron Dressler Contributed by Shamash Contributed by Joshua M Hall

What is the hiring process like for a developer?

To apply for a job, you'll have to submit a resume, cover letter, links to your portfolio projects, and your Github page. If the employer likes what they see, you will likely have a phone screen interview, through which the employer will get more information on your background and interest in the position (and also determine if you pass their baseline requirements). If they bring you on-site, you will likely have a series of interviews, each with a different focus (behavior assessment, portfolio/code review, on-the-spot programming observation). Every company's different, but this is the sort of application process I would prepare for!

Contributed by Adam Kinson

How the Web Works

What is the internet?

Simply put, the internet is a global system of interconnected computers and devices, all communicating with each other via a common language (or standard protocol).

Contributed by Daniel Au

How is information broken down and sent?

It is broken down into packets and sent through random different ways to get to their destination.

What are packets?

Packets are bits of data that are parts of a whole that are sent from one computer or server to another. An image, video or some other asset is requested by a client and the host serves them up by breaking it down into smaller chunks called packets that are sent out with information attached to them that signifies where they are to be routed and how to piece them all back together.

Contributed by Dondi Fusco

What is a "client"?

A client is a device that need to get something. For example if we want to watch videos on Youtube, so we're client. It is a device or a program which interacts with the server. It is, in that sense, the interface between the server and the users. It requests information via a server for various functions including website browsing, management, e-mail, and the use of various applications.

With regard to the World Wide Web, the client is a user's browser. When a user opens a browser on their computer, the browser waits for the user to take an action; depending on the action, the browser may make a request to the server, asking for a resource. Then, as long as there aren't any errors, the server will respond with the requested resource. The browser then waits for another action from the user and the cycle continues.

Contributed by Bagus Aji Santoso Contributed by PGiese Contributed by Sarah Fox Contributed by Clayton Perszyk Contributed by Shamash Contributed by Joshua M Hall

What is a "server"?

A server is a special computer programm (like Apache) that waits for a request from the client. When the client sends their requests, server will look for it. If the server found what the client wants, the server then will return the data to the client. If the server can't found what the client want, then the server will tell the client that what they want is not present on the server.

Basically, it enables the sharing of resources and information for various applications, websites, and email, and brings that information to computers over the internet at the request of the client!

The server waits for requests from a client and tries to produce the proper response. If the server cannot properly respond to a request, it will respond with an error that attempts to help the client understand what went wrong (e.g., a 404 NOT FOUND response indicating a web server couldn't find the requested resource). On the Web, a server waits for requests from a client (i.e., browser) and responds with the requested resource or an error if there is an error.

Contributed by Bagus Aji Santoso Contributed by PGiese Contributed by Sarah Fox Contributed by Clayton Perszyk Contributed by Joshua M Hall

What is HTTP and how does an HTTP request work?

HTTP stands for Hypertext Transfer Protocol, which is the standard method used to request and transmit data across the internet. When a user enters a URL in their browser, the browser generates the HTTP request and sends it to the server, which also responds via HTTP to provides the data & files for the requested site.

Contributed by Adam Kinson

What are DNS servers?

A DNS server is a special kind of computer that links human-readable names of web sites, such as www.google.com, to their actual IP address location.

For example, instead of typing www.google.com and asking a DNS server to look-up the address of google for you, you can simply enter http://74.125.224.72/ directly into your browser!

Contributed by Daniel Au

What is HTML and how is it used?

Hypertext markup language, a language of tags used to define the structure and content of Web pages, such as headings, lists, paragraphs, line breaks, images, etc. Contributed by Michael Alexander

What is CSS and how is it used?

Cascading Stylesheets, a language that describes the look and style of the elements defined in an HTML document, such as fonts, colors, spacing, transparency, alignment, and other design aspects of a page. In short, it makes the raw information look pretty, and it makes the front end simpler by separating presentation from content.

Contributed by Michael Alexander

What is your browser's Web Inspector (aka Developer Tools) and how can you use it to poke around in a page's HTML?

Developer Tools will show you the actual HTML and CSS that generated content on the page. By hovering over items, you can see how they were defined in HTML, how they were styled in CSS, and any other relevant attributes. You can open up the Developer Tools by right-clicking in the browser and selecting "Inspect Element."

The Web Inspector is a tool that allows you to view a web page’s source, the DOM hierarchy, debug Javascript, and more.

Contributed by Adam Kinson

What happens behind the scenes after you click "search" on google.com?

A single click rings out on a dark night... Picoseconds later (a lot of them) later the input is received by a usb or other peripheral device port Nanoseconds later (a pile of them) a short string of integers is sent and interpreted by the CPU of device used as a "click". Milliseconds later (a group of them) a command is sent to open up an http handshake Microseconds late (a few of them) the handshake is confirmed and search query data is exchanged Centiseconds later (a handful of them) the data is processed and the return data is exchanged Decaseconds later (two point five of them, in this case) your search is returned to your screen.

"About 98,600,000 results (0.25 seconds) https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=divisions+of+a+second”

There was a great reddit post on this somewhere that I filed away mentally. I will return it (in far more than .25 seconds) when I find it.

Contributed by Daniel R. Dugan

The Command Line

What is the command line?

A terminal/shell that one opens and types in commands for various tasks (moving between directories, opening, editing files, removing files, changing settings and permissions, ,etc) Contributed by Michelle Ho

How do you open it on your computer?

Type cmd under Start > Run on Windows, or Command + Space, type terminal on OSX, then hit Enter.

Contributed by Aaron Dressler

What is Bash?

"Abbreviation for Bourne-Again SHell, the command-line shell for GNU/Linux." Contributed by Michael Alexander

How can you navigate into a particular file directory?

$ cd <directoryName> Contributed by Michelle Ho

How can you create a directory?

$ mkdir <directoryName> Contributed by Michelle Ho

How can you destroy a directory or file?

$ rm <fileName> $ rm -rf <directoryName> Contributed by Michelle Ho

How can you rename a directory or file?

$ mv <oldFileName> <newFileName> Contributed by Michelle Ho

Why are file permissions important?

prevent unwanted access and/or modification of files. Permissions often are for read, write, execute?

How do you view hidden files in a directory?

$ ls -a Contributed by Michelle Ho

How do you find information about a particular command?

$ man <cmd> Contributed by Michelle Ho

What is a "Superuser" and how do you execute commands as this user?

The "Superuser" is a user of a computer system with special privileges needed to administer and maintain the system. Superuser commands can be executed using 'sudo' in the command line, which stands for Superuser do.

'sudo' allows a user to run programs with the security privileges of another user, often the superuser or root user.

Contributed by Matt Davis

What is Vim?

Text editor that often causes debates with emacs lovers. Contributed by Michelle Ho

Vim is an improved version of the vi editor that is included in most UNIX systems. Highly configurable it was built to enable efficient text editing which makes it quite useful for programming. Some even consider it an entire IDE. Contributed by René Maya

How do you quit Vim if you get stuck in it?

:q

:q! (to overwrite and not save any changes) Contributed by Michelle Ho

:qa! Contributed by Andur Carr

What is the .bash_profile file and what is it used for?

The bash '.bash_profile' file is a startup file for the bash shell and is used for many things such as declaring the $PATH variable for login shells. Contributed by Jason Barkley

What is the $PATH variable?

The $PATH variable is an environmental variable in the GNU/Linux and other UNIX-like operating systems that tells shell which directories to search for executable files in response to commands issued by a user.

$PATH dictates the locations within a file tree that contains commands executable within a command line setting

Contributed by Jason Barkley Contributed by Dakota Maulding

Why might you need to add onto your $PATH variable?

You might need to add onto your $PATH variable so an application can be found and run in the command line. Contributed by Richard Peterson

What are alias commands?

Alias commands are shortcuts that can be set up for use with the command line. These are often set for convenience so things such as long scripts that are often repeated don't need to be fully typed out.

For instance, when using Sublime Text, one may not want to always manually locate files and open them using the application. Instead, an alias can be set such as 'subl' which can be used in the command line preceding the filename. This opens the file in sublime text, voila!

i.e. 'subl text.txt'

Contributed by Matt Davis

Terms to Know

Define the following:

The Web

URL( Uniform Resource Locator)

Address that one types in to reach a particular webpage. Human readable address that eventually gets mapped through DNS into actual IP addresses. Contributed by Michelle Ho

Domain

The part of the URL which specifies the location of the web server who is going to respond to your request. Contributed by Richard Peterson

IP Address

IP addresses are the absolute address of a website. Four number ranging from 0 to 255 and separated by commas, these are unique but difficult to remember for the everday user - hence the creation of URLs and the DNS.

Contributed by Malcolm Reddoch

A specific and unique numeric signifier of a networked entity; can be an appliance, computer, phone, etc.

Contributed by Dondi Fusco

DNS

The Domain Name System, or DNS, is the phone book of the Internet. It takes human-readable URLs and translates them to IP addresses so that packets know exactly where to go.

Contributed by Malcolm Reddoch

HTTP

HTTP stands for Hypertext Transfer Protocol. It is the protocol or standard used for transferring information around the web. It is the agreed upon way a browser (or client) and server "talk" through requests by the browser (or client) and responses by the server.

HyperText Transfer Protocol, defines how messages are formatted and transmitted and what actions web servers and browsers should take in response to various commands. For example a URL request to retrieve a web page from a server.

Contributed by Yoshio Varney

HTTPS

HyperText Transfer Protocol Secure is the secure version of HTTP, and is basically HTTP wrapped in another layer, TLS / SSL.

HTTPS is used to prevent "impostor" and "man-in-the-middle" attacks, among others. Any submitted form data sent "over the wire" can be read very easily by a malicious user, so it is universally recommended that any sensitive information is transmitted via HTTPS.

Contributed by Aaron Dressler

POP & IMAP & SMTP

POP stands for Post Office Protocol, IMAP for Internet Messaging Access Protocol,and SMTP for Simple Mail Transfer Protocol. These are set of protocols for handling email.

API

API stands for Application Programming Interface, which is a set of programming instructions and standards for accessing a Web-based software application. Software companies typically release APIs to the public so that other software developers can design products that are powered by its service.

For example, Amazon.com released its API so that web developers could more easily access Amazon's product information. Using the Amazon API, a third-party website can post direct links to Amazon products with updated prices and product descriptions.

Contributed by Matt Davis

Web Server

A program usually running on a remote computer that responds to requests from a browser.

Contributed by [Unknown]

Bugs

An error or defect in software or hardware that causes a program to malfunction. Typically coding issue, but has extended to other fields.

For example: From DARPA newsletter 6.11.2009 "Code compiled successfully (completed tier 1.6 of Google/Haliburton world takeover project), but during deployment we found several bugs where sample populations were still able to think and feel independently.

Contributed by Yoshio Varney Contributed by Daniel R. Dugan

The Cloud

Cloud computing is the practice of using a network of remote servers hosted on the Internet to store, manage, and process data, rather than a local server or a personal computer.

Contributed by Aaron Dressler

Cookies

A text file stored by the browser which is sent back to the server each time the browser requests a page from the server. Mainly used to identify users and possibly prepare customized web pages for them.

Session (or transient) cookies are stored in temporary memory and erased when browser is closed, they do not collect info on user. Instead, they store information in the form of a session identification that does not personally identify the user. Persistent (or permanent) cookie are stored on hard drive until it expires at expiration date or until user deletes it. They are used to collect identifying info about the user such as surfing behavior or user prefs for a site.

Contributed by Yoshio Varney

404 Error

The frustrating page a user receives when the specific page he or she was hoping to access doesn't exist. Can be made less frustrating if it is accompanied by a clever joke, or a picture of a kitten.

Contributed by Malcolm Reddoch

Nasty error when a page is not found when requested that the hosting domain alerts the user/requester with.

Contributed by Dondi Fusco

The HTTP Status Code returned by a server indicating file not found.

Contributed by Aaron Dressler

SEO

How your customers find you online matters to an entrepreneur and/or a line of business process owner. Your customers often are customers of your competitors. SEO (search engine optimization) is the process of producing content that is:

  1. Interesting enough to your customers that they find it organically and choose it over competitive products.
  2. Interesting enough to the search engine provider to bump it up to the first page instead of competitive products.
  3. Tricky enough to pretend to be one of the first two by gaming the search algorithm.

Contributed by Daniel R. Dugan

Design

WYSIWYG

"What you see is what you get". Often a GUI interface where the changes you make in your editor are nearly identical (in theory) to the changes you will see on your page.

Contributed by Nick Schwaderer

Responsive Design

Ensuring that all possible devices and browsers are capable of properly displaying the intended content including: very easy to read and navigate; minimum need for panning and scrolling; and no need to resize.

Contributed by Jasen Carroll Contributed by Richard Peterson

Grid System

The design structure for building a web page. A grid system streamlines the web development workflow by serving as a visual guide on which designers can organize graphic elements on a page in relation to other graphic elements on the page or even other parts of the same element or shape.

Grid systems speed up the design process while making the web page more visually appealing, but are not mandatory. However, working without a grid system will require sizing every column on the page without any sort of guide, that will then need to be applied to every page manually.

Even though grids are not necessary to design a web page, they make the process much easier and better looking visually.

Contributed by Sarah Fox Contributed by Christopher Vicini Contributed by Bagus Aji Santoso

RGB

Short for red, green and blue, the three colors that make up a pixel. Each is an integer between 0 and 255, and a combination of three integers specifies a color to display.

Contributed by Dan Berger

Hex

Hexadecimal: a base-16 numeral system. Digits are 0-9, a-f. Example: Hexadecimal(1c) == Decimal(28). In the context of color, Hexadecimal is used to numerically represent Red, Green, and Blue content, using three pairs of digits. This allows 256^3 (over 16 million) unique colors. Color example: #00ff00 is Green.

Contributed by Andur Carr

Above the Fold

Content that is visible immediately when the page is loaded, without having to scroll. Good design will place important elements here so the site's visitors don't have to scroll to find content. A reference to olde-tymey newspaper formatting, where headlines would be placed prominently above the physical fold.

Contributed by Dan Berger and Nick Schwaderer

GUI

Graphical User Interface. This is the modern interface that is used across a multitude of computers and devices and allows a user to interact with the electronic device through graphics and indicators. Basically if it isn't a text-based interface it's a GUI. It is used as a generic term for a visual interface that the user can interact with.

Contributed by Jasen Carroll Contributed by Chris Fullinwider

Front End / Back End

"Front End" refers to browser, and languages like HTML, CSS and JavaScript that work within the browser. "Back End" refers to the server that hosts the web application, and frameworks like Rails that operate on those servers.

Contributed by Dan Berger

Developer Tools and Code

HTML

The markup language which specifies the structure of all the pieces of a webpage.

Contributed by Ashton Christie

Hypertext markup language: The coding read by web browsers that dictates the layout and style of coding within a web server.

Contributed by Dakota Maulding

CSS

"Cascading Style Sheets" find HTML tags and tell the browser how to display them.

Contributed by Ashton Christie

Javascript

The scripting language that runs in the browser. It allows interactivity with the user. It is also invading the back-end with the popularity of nodejs.

AJAX

AJAX stands for Asynchronous JavaScript and XML, and it is a programming concept used to enable web pages to exchange data with a server without the user having to refresh/reload the entire page. It allows for web applications to send and receive data in the background. A good example would be real-time updating of a twitter or facebook feed.

Contributed by Adan Camacho Contributed by Jasen Carroll Contributed by Chris Fullinwider

Pseudo-Code

Basically shorthand for what you are planning to code. It's like sketching for programmers.

C

An older, light weight programming language that direcly inspired the development of many other languages. It's one of the lowest forms of programming language, one step removed from machine language.

Ruby

Ruby is the most enjoyable language on earth. Easy and happy to code.

Ruby is a dynamic, object-oriented programming language. Created by Yukihiro "Matz" Matsumoto who has said that "The goal of Ruby is to make programmers happy".

Contributed by René Maya

Ruby Gems

Ruby Gems are Ruby programs and libraries in a self-contained format called a "gem" packaged by RubyGems package manager, a tool designed to easily manage the installation of gems and a server for distributing them.

Part of the Ruby programming language, RubyGems is a package manager that makes it easy to download, install and run ruby programs and libraries (“gem”) and it’s files through a simple terminal command.

Essentially, a gem consists of two things: code and a gemspec (specifications for that gem) which is then used by rubygems to handle the management of the code.

Most gems are open source, and used in most applications. The majority of gems provide command line utilities that can automate tasks and speed up your work.

Contributed by Olga Contributed by Christopher Vicini Contributed by Clayton Perszyk

Frameworks

A framework is a platform where common code with generic functionality is ready to be used by developers along with possibility to write custom code.

A framework is a collection of libraries that are used for building web applications. It saves a lot of time as instead of reinventing a wheel, developer can use source code which is already there, tweak it according to needs and use it for it's website. Example - Instead of spending hours on creating interactive website with census form from scratch, I can use existing forms and change ie. date format, size, shapes of particular web elements.

Contributed by Olga Contributed by Dariusz Biskupski

Ruby on Rails

Ruby on Rails is the amazing web framework for creating awesome web applications. If you want to live on edge, RoR is the right choice.

Command Line

The interactive shell where you can enter commands that will be run by your operating system. Also useful for navigating your file system.

Contributed by Ashton Christie

Version Control

It's like a time machine for jumping back and forth between specific time stamp for coding.

Git

One of the most popular open-source version control systems.

Open Source

Free licensed code.

Contributed by Olga

CMS

CMS stands for Content Management System, which is an application used to manage the content of a website. The purpose of a CMS is to make updating a website's content easier, enabling administrators to make changes efficiently without the need for coding expertise.

Contributed by Adan Camacho

Database

A database is a collection of information that is organized so that it can easily be accessed, managed, and updated. They cornerstone of every web application. This is where everything your users do is saved. Like a giant collection of giant spreadsheets that moves really fast.

Contributed by Mike Donnelly

SQL

Abbreviation of Structured Query Language, and pronounced either see-kwell or as separate letters. SQL is a standardized query language for requesting information from a database. The original version called SEQUEL (structured English query language) was designed by an IBM research center in 1974 and 1975. SQL was first introduced as a commercial database systemin 1979 by Oracle Corporation. Although there are different dialects of SQL, it is nevertheless the closest thing to a standard query language that currently exists.

Contributed by Mike Donnelly

XML

Extensible Markup Language (XML) is a text-based format that allows for the structuring of electronic documents and is not limited to a set of labels. XML is used to describe data. The XML standard is a flexible way to create information formats and electronically share structured data via web services on the public Internet.

Contributed by Mike Donnelly

Schema

Schema - defines a set of rules as to how XML documents should look like, what tags are used for what actions, where and how to use them.

Example: --This definition is in the schema document:

--This is the effect in XML document; List tags are with capital first letter, should include one or more Items which is defined by + sign. Chocolate

In similar to XML way, HTML documents are defined by DTD (Documents Type Definition) which famous manifastation is

Contributed by Dariusz Biskupski

Script

Magic invocation, which could be casted by mage in a matter of a minutes. Don`t need tough preparations and internisation. You could write spells in .rb files and than order your Ruby individual to cast it.

Contributed by Shamash

Installations

Why did you need to install Ruby?

As we might recall, back-end programming means coding on the server side. Since not all servers run the same programming languages we need to make sure we install in our computer the same language. When we install Ruby we are actually installing the Ruby interpreter which allows us to "run" our code locally so we can make sure that our Ruby programs will be executed correctly by our server.

Contributed by René Maya

Why didn't you need to install HTML, CSS and Javascript?

These are already native to the browsers and do not need a compiler or back end to interpret. They can also be authored in a simple text editor. Contributed by Dondi Fusco

Most web browsers have the ability to decode all of the before mentioned languages.

Contributed by Dakota Maulding

What is RVM and how will it be useful later?

RVM stands for Ruby Version Manager and is a command-line tool which allows you to easily install, manage, and work with multiple ruby environments from interpreters to sets of gems.

RVM is helpful because some gems, tools, and frameworks may only work with a particular version of Ruby. RVM lets you easily switch between different environments, based on needs, when developing.

Contributed by Matt Davis

What is XCode?

An integrated development environment (IDE) created by Apple for developing OS X and iOS software.

Contributed by Andur Carr

Git

What is Git?

Git is the most popular distributed version control system used for software development. It is used to efficiently maintain and manage code for a project, is free and open source, has an emphasis on speed and data assurance, and allows for multiple workflows which can branch out or merge as needed.

Contributed by Adan Camacho

What does SCM stand for?

Source Code **M*anagement is generally achieved via software that provides coordination, communication and version control services to developers. Contributed by Alex Clifford

What is a VCS?

Version Control Systems (like Git) provide monitored and regulated access to a software repository.

Contributed by Alex Clifford

Why is Git useful for a developer?

Git version control system is useful for a developer because it allows the developer the ability to access previous versions of their project, essentially being able to rewind time if they decide that a previous commit is better suited for their needs; be it a current implementation isn't working out, or to investigate changes to find where any problems may exist.

Contributed by Allan Beals-Gibson

Why is Git useful for a team of developers?

Using Git allows a team of developers to independently work alongside one another, while having the ability to seamlessly implement those changes to the main project. It also helps situations where independent developers work may contradict each other, by showing changes and allowing the developers to choose which ones they would like to keep.

Contributed by Allan Beals-Gibson

The Basics

How do you create a new Git repository for a project locally?

To create a Git repository locally, you want to navigate to the root directory of your project and type 'git init'. This will initialize a local repository and load all of the necessary files git will need to track the files in that directory.

Contributed by Matt Davis

How do you create it on Github?

By clicking on the plus symbol ('+') of your github user account and selecting NEW REPOSITORY Contributed by Dondi Fusco

How do you commit changes?

By typing a git command, "git commit -m "Your message". It will move the files from staged to unmodified. Type "git status" prior to commit. You can see "Changes to be committed:". Type "git status" again after commit, you will see "nothing to commit, working directory clean".

The other way is typing a git commit -am "Your message", which will both stage and commit changes.

Contributed by Coco Matthey

What is the difference between staging and committing changes?

Staging is moving files from Modified to Staged by issuing a git command, "git add your_file", "git add . ", or "git add -A". Committing is moving files from Staged to Unmodified.

Contributed by Coco Matthey

Remotes

What is the difference between committing your changes and pushing them to Github?

Committing your changes will only save them in your local repository. Pushing them to Github will save them to your remote repository.

Contributed by Clayton Perszyk

What is the difference between a "remote" and your local repo?

A remote repo allows you to either pull upstream changes from the master repo, or publish (push) your local commits. A local repo is the enviroment where we can make local changes and is typically the one on our computer.

Contributed by Christopher Vicini

How do you add your Github repo as the remote?

git remote add origin URL

URL is copied from my repo in my GitHub account Contributed by Dariusz Biskupski

How do you check the status of your current repo in git?

git status Contributed by Dondi Fusco

How do you see the history of your previous commits (from the command line)?

git log Contributed by Dondi Fusco

How can you look through your historical commits on the Github website?

You can look through a history of commits by clicking on the repository name and then clicking the commits. Contributed by Jason Barkley

Branching and Merging

What is a "Merge"?

A merge is when you take the changes you've made on one branch, and bring them into another branch to update it with the new changes.

Contributed by Allan Beals-Gibson

What is a "Pull Request"?

A pull request is when you contribute to someones else's project, and you let them know that you have made changes that they can look over and possibly implement into their project.

Contributed by Allan Beals-Gibson

What is "Forking" a repo?

Making a copy of another master repo into your own github account so as to not disturb the master in order to do work on it, make changes and/or corrections and later submit for a pull request Contributed by Dondi Fusco

What is "Cloning" a repo?

Making an identical copy of a Git repo on your local server is "cloning" the repo. This is different from forking, where a copy of a repo is made in Git itself.

Contributed by Alex Clifford

What is "Branching"?

In Git, branching is a way of duplicating your project so two different versions can be modified in tandem. The changes can then be merged back into the master branch.

Branching is when the developer creates a separate version of their local repository (master branch), allowing changes to be made to that new branch, that won't affect their master until the developer wishes to merge the changes.

Contributed by Allan Beals-Gibson Contributed by Clayton Perszyk

Why would you use a branch?

Using a new branch allows the developer to make experimental changes to their project while having the ability to either discard those changes later, or merge them into their main project. It also allows teams to work off the master branch simultaneously and merge them all later.

Contributed by Allan Beals-Gibson

How do you create a new branch?

Create a new branch by typing:

git checkout -b branch_name

Contributed by Allan Beals-Gibson

Why would you use a branch?

Branching allows for different features to be developed without modifying the main document. The feature can then be merged into the main document if and when desired.

Contributed by Clayton Perszyk

How do you create a new branch?

In your terminal type git branch <name of branch> to create a branch. Then type git checkout <name of branch> to start working on your new branch.

You can combine the two commands and just type git checkout -b <name of branch> and that will create and change into your new branch.

Contributed by Clayton Perszyk

How do you merge branches back together?

In order to merge branches back together you should merge the master branch into your-branch

$git checkout your-branch $git merge master

Resolve any conflicts that occur. Move back to your master branch and merge your-branch into the master branch.

$git checkout master $git merge your-branch

You'll see output indicating any changes that were made

What is a "Merge Conflict" and when will it occur?

A merge conflict occurs during a merge when the same part of some file has changed in the two different branches. For example, let's say John and Jane are working on a project together. John creates a branch for a feature he is working on. While he is working on this branch, he modifies a file that Jane has also modified on the master branch. When John attempts to merge the master branch into his feature branch, he'll receive a message that the automatic merge failed and that the conflicts need to be fixed and the changes committed.

How do you resolve a "Merge Conflict"?

In order to solve a Merge Conflict, one needs to open the conflicting file in a text editor and find the conflicting lines of code. One can find the conflict by spotting the merge markers. To resolve the this, delete the line you want to get rid of and then delete the merge markers. After deleting the merge markers, you can save the file, add it to the stage, and finally commit it. Done.

Contributed by Garrett Weinert