Git hello world



Git Hello World


Open Source

You might have heard of Open Source before, as there has been an infinite amount written about the subject, but this is a good time to learn about it. In fact, this course is entirely open source!

Open source and hacking go hand in hand. You might not feel strongly about it now, but you probably will eventually.

What is Open Source? https://opensource.com/resources/what-open-source

Git

Before we get to Github we have to learn about the software it is built around, which is named 'git'. Git was developed by…. drumroll… Linus Torvalds! Basically, once he started working on Linux with a bunch of other programmers, he needed a dedicated type of software so everyone could work on different pieces without stepping on each other's toes. What was created is something now known as a “version control system” or VCS.

There are a variety out there, but Git is clearly dominant. Git is used for version control during software development, allowing collaboration and the merging of changes in a safe and easy manner. It is used by just about everyone and is amazing. If you want to build large pieces of software, especi



Let’s start a new project and create a small amount of history:


$ mkdir test-project $ cd test-project $ git init Initialized empty Git repository in .git/ $ echo 'hello world' > file.txt $ git add . $ git commit -a -m "initial commit" [master (root-commit) 54196cc] initial commit 1 file changed, 1 insertion(+) create mode 100644 file.txt $ echo 'hello world!' >file.txt $ git commit -a -m "add emphasis" [master c4d59f3] add emphasis 1 file changed, 1 insertion(+), 1 deletion(-)


What are the 7 digits of hex that Git responded to the commit with?



We saw in part one of the tutorial that commits have names like this. It turns out that every object in the Git history is stored under a 40-digit hex name. That name is the SHA-1 hash of the object’s contents; among other things, this ensures that Git will never store the same data twice (since identical data is given an identical SHA-1 name), and that the contents of a Git object will never change (since that would change the object’s name as well). The 7 char hex strings here are simply the abbreviation of such 40 character long strings. Abbreviations can be used everywhere where the 40 character strings

gRPC in 3 minutes (Objective-C)


There are currently two ways to build projects with the gRPC Objective-C library:


Cocoapods & Xcode

Bazel (experimental)


Cocoapods

Installation

To run this example you should have Cocoapods installed, as well as the relevant tools to generate the client library code (and a server in another language, for testing). You can obtain the latter by following these setup instructions.

Hello Objective-C gRPC!

Here's how to build and run the Objective-C implementation of the Hello World example used in Getting started.

The example code for this and our other examples lives in the directory. Clone this repository at the latest stable release tag to your local machine by running the following commands:
$ git clone -b RELEASE_TAG_HERE https://github.com/grpc/grpc $ cd grpc $ git submodule update --init
Change your current directory to
$ cd examples/objective-c/helloworld
Try it!

To try the sample app, we need a gRPC server running locally. Let's compile and run, for example, the C++ server in this repository:
$ pushd ../../cpp/helloworld $ make $ ./greeter_server & $ popd
Now have Cocoapods generate and install the client libra

Hello Git: A Beginner's Tutorial on Git and GitLab


Introduction

This tutorial is for beginners who are new to Git and GitLab .


Git
is a "free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency." Use Git locally on your computer to manage software versions.


GitLab
is a DevOps platform. It can host your local Git repos for remote collaboration, and a whole lot more. Some other Git servers are GitHub and Bitbucket.

Register with GitLab and Create a Repo


Register for a GitLab account here or on your private GitLab server.

From a web browser, log into your GitLab account.


Create a new repo:



Your remote GitLab repo is created.



Install Git Locally

Make sure that you have Git locally on your computer.


Check if you already have Git. From your local computer, open a macOS Terminal or Git Bash terminal and enter: . If you have Git, then continue to Establish SSH Access.

Install Git:

Introduce yourself to Git, using your real name and email:


For the remainder of this tutorial, "terminal" refers to either the
macOS Terminal
app or
Windows Git Bash
terminal.