GITHUB
GITHUB

GITHUB

2347

What is it?
It is a web-based hosting service mostly used to manage computer code and its versions.

Why is it used?
In the age of cloud computing, the days of storing code or information on a personal laptop or disk space and transferring it over the network are gone. Reason being that handling multiple versions of the code when multiple people are trying to modify the same code would lead to disaster, in real time scenarios. So, it is imperative that your code and any changes are handled efficiently.

Is it important?
This tool is widely used in the industry wherever cloud computing and/or coding is involved.

Can it be explained in a better way?
Remember the documents and photos in your Gmail, which you move to google drive and retrieve whenever you want it? GitHub flows almost a similar approach.

How do I go about to understand and use it?

Well, follow the simple steps below.

Step 1:Sign-up in GitHub.

https://github.com/
Step 2:Install Git console.
Step 3:Choose default settings (Windows console etc.,). The console window appears as below.
Step 4:Link the git on your machine to link up with your account on GitHub. This is done via username and password which you have provided on GitHub website.

For linking your username, the command is:

Step 1:Sign-up in GitHub.

https://github.com/

Step 2: install Git console.
Step 3: Choose default settings (Windows console etc.,). The console window appears as below.

Step 4: Link the git on your machine to link up with your account on GitHub. This is done via username and password which you have provided on GitHub website.

git config-global user.name"crajahamsa"

Step 1:Sign-up in GitHub.

https://github.com/

Step 2: install Git console.
Step 3: Choose default settings (Windows console etc.,). The console window appears as below.

Step 4: Link the git on your machine to link up with your account on GitHub. This is done via username and password which you have provided on GitHub website.

Step 1:Sign-up in GitHub.

https://github.com/

Step 2: install Git console.
Step 3: Choose default settings (Windows console etc.,). The console window appears as below.

Step 4: Link the git on your machine to link up with your account on GitHub. This is done via username and password which you have provided on GitHub website.

 

Step 1:Sign-up in GitHub.

https://github.com/

Step 2: install Git console.
Step 3: Choose default settings (Windows console etc.,). The console window appears as below.

Step 4: Link the git on your machine to link up with your account on GitHub. This is done via username and password which you have provided on GitHub website.

You are done!
Now, all we need to create a repository (folder) in GitHub where the team can upload the code.

Step 1:Sign-up in GitHub.

https://github.com/

Step 2: install Git console.
Step 3: Choose default settings (Windows console etc.,). The console window appears as below.

Step 4: Link the git on your machine to link up with your account on GitHub. This is done via username and password which you have provided on GitHub website.

Give a name to the repository

https://github.com/

Step 1:Sign-up in GitHub.

https://github.com/

Step 2: install Git console.
Step 3: Choose default settings (Windows console etc.,). The console window appears as below.

Step 4: Link the git on your machine to link up with your account on GitHub. This is done via username and password which you have provided on GitHub website.

Go to the folder on your desktop where you want the GitHub created.
On the GitHub website, clone the path provided. This would copy the https path to the clipboard which would be used in the local desktop git command prompt to create a mirror folder.

Step 1:Sign-up in GitHub.

https://github.com/

Step 2: install Git console.
Step 3: Choose default settings (Windows console etc.,). The console window appears as below.

Step 4: Link the git on your machine to link up with your account on GitHub. This is done via username and password which you have provided on GitHub website.

Type "git clone" and right click to paste the clipboard information (from above step)

Step 1:Sign-up in GitHub.

https://github.com/

Step 2: install Git console.
Step 3: Choose default settings (Windows console etc.,). The console window appears as below.

Step 4: Link the git on your machine to link up with your account on GitHub. This is done via username and password which you have provided on GitHub website.

Vola! A folder got created on my laptop with the same name as I provided on the GitHub website.
Now, what happens if I drop a document in the folder on my desktop? Will it get reflected on the GitHub website?

Step 1:Sign-up in GitHub.

https://github.com/

Step 2: install Git console.
Step 3: Choose default settings (Windows console etc.,). The console window appears as below.

Step 4: Link the git on your machine to link up with your account on GitHub. This is done via username and password which you have provided on GitHub website.

No change even after refreshing the website.
The status in the git folder says that no commit was done.
There are 3 commands to be used to "copy" a file from your desktop to the GitHub.
a.add, b. commit and c. push

Step 1:Sign-up in GitHub.

https://github.com/

Step 2: install Git console.
Step 3: Choose default settings (Windows console etc.,). The console window appears as below.

Step 4: Link the git on your machine to link up with your account on GitHub. This is done via username and password which you have provided on GitHub website.

git add . (this would commit all the untracked files)

Step 1:Sign-up in GitHub.

https://github.com/

Step 2: install Git console.
Step 3: Choose default settings (Windows console etc.,). The console window appears as below.

Step 4: Link the git on your machine to link up with your account on GitHub. This is done via username and password which you have provided on GitHub website.

Step 1:Sign-up in GitHub.

https://github.com/

Step 2: install Git console.
Step 3: Choose default settings (Windows console etc.,). The console window appears as below.

Step 4: Link the git on your machine to link up with your account on GitHub. This is done via username and password which you have provided on GitHub website.

Please note that git push command would ask for your credentials to ‘copy’ the file from local desktop to the GitHub repository. If successful, the below details would show up.
We have successfully added the file to the GitHub repository. You can provide the link to your peers and colleagues to share the code.

Step 1:Sign-up in GitHub.

https://github.com/

Step 2: install Git console.
Step 3: Choose default settings (Windows console etc.,). The console window appears as below.

Step 4: Link the git on your machine to link up with your account on GitHub. This is done via username and password which you have provided on GitHub website.

If you want to pull a file from your colleague repository, you pull using the git command prompt. Since, both the folders have same files, up to date response shows up.

Step 1:Sign-up in GitHub.

https://github.com/

Step 2: install Git console.
Step 3: Choose default settings (Windows console etc.,). The console window appears as below.

Step 4: Link the git on your machine to link up with your account on GitHub. This is done via username and password which you have provided on GitHub website.

What if I use Linux or Macintosh?

Step 1:Sign-up in GitHub.

https://github.com/

Step 2: install Git console.
Step 3: Choose default settings (Windows console etc.,). The console window appears as below.

Step 4: Link the git on your machine to link up with your account on GitHub. This is done via username and password which you have provided on GitHub website.

The steps are the same except that below commands should be used on your local machine based on the Operating System you are using.

Step 1:Sign-up in GitHub.

https://github.com/

Step 2: install Git console.
Step 3: Choose default settings (Windows console etc.,). The console window appears as below.

Step 4: Link the git on your machine to link up with your account on GitHub. This is done via username and password which you have provided on GitHub website.

For LINUX:

Step 1:Sign-up in GitHub.

https://github.com/

Step 2: install Git console.
Step 3: Choose default settings (Windows console etc.,). The console window appears as below.

Step 4: Link the git on your machine to link up with your account on GitHub. This is done via username and password which you have provided on GitHub website.

Disclaimer: The following screenshots have been used from the below link https://product.hubspot.com/blog/git-and-github-tutorial-for-beginners. Please go through the same for elaborate details.

Step 1: Install the Git console for Linux.
Step 2: Go to the directory you want to create a folder.
Step 3: Initialize the repository

Step 4: Create a file in the same directory.

Step 5: To see if GitHub has identified the new file.

Step 6: There are two important points here.

Step i: The files/changes you want to move to GitHub must be added to the staging

environment. This step is primarily to make sure not all the files under the directory are

moved to the GitHub every time. So, you select specific files only (which you need to

overwrite in the master aka GitHub) by adding them to the staging environment.
Use the below command to add the specific files to the staging environment.
git add

 Step ii: If you want the files in the staging to be written to the GitHub, then use the commit step.

For Mac OS X:

Step 1:  Install the Git Console for Mac.
 

Note: If you get a warning that says “git-2.8.1-intel-universal-mavericks.pkg” can’t be opened because it is from an unidentified developer.” Open Settings > Security & Privacy > General and click Open Anyway.

Step 2: Open Terminal and enter git –version. You will see “git version 2.15.1”.

Step 3: Repeat the same steps as shown under the Windows options to get the initialization and creation of directory in Mac.

There are other options like Homebrew, MacPorts, Atlassian Sourcetree to do the same git installation more effectively in Mac OS X.

Summary: GitHub is highly recommended and used in real-time projects across the data science community. These are the basics to get started. There are many other options like vim command for file changes, branch in GitHub which can be explored as and when needed.

Post Comments

Call Us