Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Other

Git and Gitup

Rating
-
Sold
-
Pages
2
Uploaded on
11-06-2025
Written in
2024/2025

Enjoy

Institution
Course

Content preview

Version control systems (VCS) are tools that help developers track and manage
changes to their code over time. By keeping a record of every modification, VCS
allows developers to revert back to previous versions of their project if
necessary.

One popular VCS is Git, which was created by Linus Torvalds in 2005 for development
of the Linux kernel. Git is a distributed version control system, meaning that
every developer's working copy of the code contains the full history of the
project. This makes it easy for developers to work independently, without needing
to be constantly connected to a central server.

When using Git, developers create a local repository on their computer, which
contains all the files and revision history for the project. They can then make
changes to the code, commit those changes to the local repository, and push the
changes to a remote repository when they're ready to share them with others.

Here's an example of how you might use Git to track changes to a simple HTML file.
Let's say you have a file called index.html that looks like this:

<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
</head>
<body>
<h1>Welcome to my website!</h1>
<p>This is a simple HTML page.</p>
</body>
</html>
To start tracking changes to this file with Git, you would first need to create a
local repository and initialize it with the git init command:

$ git init
Next, you would tell Git to start tracking the index.html file by adding it to the
staging area with the git add command:

$ git add index.html
Once the file is staged, you can commit the changes with a message describing what
you did using the git commit command:

$ git commit -m "Initial commit of index.html"
Now, let's say you want to make some changes to the index.html file, such as adding
a new paragraph and changing the title. You would make the changes, then add the
modified file to the staging area again with git add:

$ git add index.html
You can then commit the changes with another message using git commit:

$ git commit -m "Added new paragraph and changed title"
At this point, you might want to push your changes to a remote repository, such as
GitHub, so that others can see and collaborate on your work. To do this, you would
first need to create a remote repository on GitHub, then add it as a remote to your
local repository with the git remote add command:

$ git remote add origin https://github.com/your-username/your-repo.git
Finally, you can push your commits to the remote repository with the git push
command:

$ git push -u origin master

Written for

Course

Document information

Uploaded on
June 11, 2025
Number of pages
2
Written in
2024/2025
Type
OTHER
Person
Unknown

Subjects

$8.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
domasticemail

Get to know the seller

Seller avatar
domasticemail Government school
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
10 months
Number of followers
0
Documents
1
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions