100% found this document useful (1 vote)
86 views

Case Study 3 - Report On Git: Introduction To Github

This document provides an introduction and overview of Git and GitHub. It discusses how Git is used for version control and tracking changes to code. GitHub builds on Git and allows for collaboration between developers by facilitating social coding and features like forking repositories, pull requests, and merging code. The document also provides a high-level summary of common Git commands like push, commit, pull, and status. It concludes with step-by-step instructions on how to set up a basic project with Git, Bitbucket, and VSCode for beginners.

Uploaded by

Gunik Maliwal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
86 views

Case Study 3 - Report On Git: Introduction To Github

This document provides an introduction and overview of Git and GitHub. It discusses how Git is used for version control and tracking changes to code. GitHub builds on Git and allows for collaboration between developers by facilitating social coding and features like forking repositories, pull requests, and merging code. The document also provides a high-level summary of common Git commands like push, commit, pull, and status. It concludes with step-by-step instructions on how to set up a basic project with Git, Bitbucket, and VSCode for beginners.

Uploaded by

Gunik Maliwal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Case Study 3 - Report on Git

Gunik Maliwal - 19223032

● Introduction to GitHub.

GitHub is a web-based version-control and collaboration platform for software


developers. Microsoft, the biggest single contributor to GitHub, initiated an acquisition of
GitHub for $7.5 billion in June, 2018. GitHub, which is delivered through a
software-as-a-service (SaaS) business model, was started in 2008 and was founded on
Git, an open source code management system created by Linus Torvalds to make
software builds faster.

Git is used to store the source code for a project and track the complete history of all
changes to that code. It allows developers to collaborate on a project more effectively by
providing tools for managing possibly conflicting changes from multiple developers.
GitHub allows developers to change, adapt and improve software from its public
repositories for free, but it charges for private repositories, offering various paid plans.
Each public or private repository contains all of a project's files, as well as each file's
revision history. Repositories can have multiple collaborators and can be either public or
private.

GitHub facilitates social coding by providing a web interface to the Git code repository
and management tools for collaboration. GitHub can be thought of as a serious social
networking site for software developers. Members can follow each other, rate each
other's work, receive updates for specific projects and communicate publicly or privately.

Three important terms used by developers in GitHub are fork, pull request and merge. A
fork, also known as a branch, is simply a repository that has been copied from one
member's account to another member's account. Forks and branches allow a developer
to make modifications without affecting the original code. If the developer would like to
share the modifications, she can send a pull request to the owner of the original
repository. If, after reviewing the modifications, the original owner would like to pull the
modifications into the repository, she can accept the modifications and merge them with
the original repository. Commits are, by default, all retained and interleaved onto the
master project, or can be combined into a simpler merge via commit squashing.
● Features of GitHub.

1. Easy Project Management

GitHub is a place where project managers and developers come together to coordinate, track,
and update their work so that projects are transparent and stay on schedule.

2. Increased Safety With Packages

Packages can be published privately, within the team, or publicly to the open-source community.
The packages can be used or reused by downloading them from GitHub.

3. Effective Team Management

GitHub helps all the team members stay on the same page and organized. Moderation tools like
Issue and Pull Request Locking help the team to focus on the code.

4. Improved Code Writing

Pull requests help the organizations to review, develop, and propose new code. Team members
can discuss any implementations and proposals through these before changing the source code.

5. Increased Code Safety

GitHub uses dedicated tools to identify and analyze vulnerabilities to the code that other tools
tend to miss. Development teams everywhere work together to secure the software supply chain,
from start to finish.

6. Easy Code Hosting

All the code and documentation are in one place. There are millions of repositories on GitHub,
and each repository has its own tools to help you host and release code.

Now that we’ve gained some familiarity with GitHub let’s check out the competition.
● Introduction to Bitbucket.

Bitbucket owned by Atlassian web based version control repository management tool and now
days widely use in software industries. Almost all the software industries adopt the Bitbucket for
small to large scale software development.

Bitbucket written in Python using the Django web framework and for source code and
development use either Mercurial or Git revision control system. Bitbucket offer both commercial
plan and free account and with free account provide a facility to create unlimited private
repositories but with up to five user account only.

Bitbucket owned by Atlassian so you can easily integrates with other Atlassian software like Jira,
HipChat, Confluence, Bamboo, Slack and Jenkins.

● How Bitbucket is associated with Git.

Git provides various tools and applications to perform better handling of the work environment.
Git is a type of version control system that is used to allow more than one developer to access
the source code of a specific application and can modify changes to it which may be seen by
other developers.

Let’s suppose you are developing a project that is divided between various teams and will work
on different versions during and after development. For this kind of project, Bitbucket is the best
option for individuals or teams.

BitBucket is a git-based tool that helps on collaborations on large projects across various teams
and helps keep a track of different versions of a project that can access it from your local
machine.

It is specially designed for teams to collaborate on large projects in big enterprises. It is also
used for automated testing and deployment of code. Since this is a git-based tool, you need to
have git in your system to work with Bitbucket.
● Command-line statements like Push, Commit, etc.

git push

Pushing is the opposite of fetching (with a few caveats). It lets you move a local branch to
another repository, which serves as a convenient way to publish contributions. This is like svn
commit, but it sends a series of commits instead of a single changeset.

git commit

Takes the staged snapshot and commits it to the project history. Combined with git add, this
defines the basic workflow for all Git users.

git config

A convenient way to set configuration options for your Git installation. You’ll typically only need to
use this immediately after installing Git on a new development machine.

git pull

Pulling is the automated version of git fetch. It downloads a branch from a remote repository,
then immediately merges it into the current branch. This is the Git equivalent of svn update.

git reset

Undoes changes to files in the working directory. Resetting lets you clean up or completely
remove changes that have not been pushed to a public repository.

git status

Displays the state of the working directory and the staged snapshot. You’ll want to run this in
conjunction with git add and git commit to see exactly what’s being included in the next snapsho

● How to deal with Git, Bitbucket, and code editor (e.g., VSCODE) for beginners. (Show
Step by Step with images).

Step 1 — Familiarizing with the Source Control Tab

The first thing you need to do to take advantage of source control integration is initialize a project as a Git reposit
Visual Studio Code and access the built-in terminal. You can open this by using the keyboard shortcut CTRL + `

Linux, macOS, or Windows.

In your terminal, make a directory for a new project and change into that directory:

mkdir git_test

cd git_test

Then, create a Git repository:

git init

Another way to accomplish this with Visual Studio Code is by opening up the Source Control tab (the icon looks li

in the road) in the left-side panel:

Next, select Open Folder:


This will open up your file explorer to the current directory. Select the preferred project directory and click Open.

Then, select Initialize Repository:


If you now check your file system, you will see that it includes a .git directory. To do this, use the terminal to nav

your project directory and list all of the contents:

ls -la

You will see the .git directory that was created:

Output

..
.git

Now that the repo has been initialized, add a file called index.html.

After doing so, you’ll see in the Source Control panel that your new file shows up with the letter U beside it. U stan

untracked file, meaning a file that is new or changed, but has not yet been added to the repository:

You can now click the plus icon (+) by the index.html file listing to track the file by the repository.

Once added, the letter next to the file will change to an A. A represents a new file that has been added to the repos

To commit your changes, type a commit message into the input box at the top of the Source Control panel. Then,

check icon to perform the commit.


After doing so, you will notice that are no pending changes.

Next, add a bit of content to your index.html file.

You can use an Emmet shortcut to generate an HTML5 skeleton in VS Code by pressing the ! key followed by Tab

ahead and add something in the <body> like a <h1> heading and save it.

In the source control panel, you will see that your file has been changed. It will show the letter M next to it, which s

for a file that has been modified:


For practice, go ahead and commit this change as well.

Step 2 — Interpreting Gutter Indicators

In this step you will take a look at what’s called the “Gutter” in VS Code. The gutter is the skinny area to the right o

number.

If you’ve used code folding before, the maximize and minimize icons are located in the gutter.

Let’s start by making a small change to your index.html file, such as a change to the content within the <h1> ta

doing so, you will notice a blue vertical mark in the gutter of the line that you changed. The vertical blue mark sign

that the corresponding line of code has been changed.

Now, try deleting a line of code. You can delete one of the lines in the <body> section of your index.html file. N
now in the gutter that there is a red triangle. The red triangle signifies a line or group of lines that has been deleted

Lastly, at the bottom of your <body> section, add a new line of code and notice the green bar. The vertical green b

signifies a line of code that has been added.

This example depicts gutter indicators for a modified line, a removed line, and a new line:

Step 3 — Diffing Files

VS Code also has the ability to perform a diff on a file. Typically, you would have to download a separate diff tool t

this, so this built-in feature can help you work more efficiently.

To view a diff, open up the source control panel and double-click a changed file. In this case, double-click the

index.html file. You will be brought to a typical diff view with the current version of the file on the left and the pr
committed version of the file on the right.

This example shows that a line has been added in the current version:

Step 4 — Working with Branches

Moving to the bottom bar, you have the ability to create and switch branches. If you take a look at the very bottom

the editor, you should see the source control icon (the one that looks like a split in the road) followed most likely b

master or the name of the current working branch.

To create a branch, click on that branch name. A menu should pop up giving you the ability to create a new branch
Go ahead and create a new branch called test.

Now, make a change to your index.html file that signifies you are in the new test branch, such as adding the t

is the new test branch.

Commit those changes to the test branch. Then, click the branch name in the bottom left again to switch back to

master branch.

After switching back to the master branch, you’ll notice that the this is the new test branch text comm

the test branch is no longer present.

Step 5 — Working with Remote Repositories

Through the Source Control panel, you do have access to work with remote repositories. If you’ve worked with a re

repository before you’ll notice familiar commands like pull, sync, publish, stash, etc.

Step 6 — Installing Useful Extensions

Not only does VS Code come with lots of built-in functionality for Git, there are also several very popular extension

additional functionality.

Git Blame

● Conclusion

Git provides a way of keeping track of past versions of software and papers, making collaboration
between various authors easy, and provides backup for your software. It has proven very useful to the
open-source community and in academia as well..

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy