0% found this document useful (0 votes)
17 views4 pages

Exercise 3

Ex3

Uploaded by

Venkat Marturi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views4 pages

Exercise 3

Ex3

Uploaded by

Venkat Marturi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Exercise 4:

Module name: Implementation of CICD with Java and open-source stack

Configure the web application and Version control using Git using Git commands and version
control operations.

What is GIT?

Git is a free open-source distributed version control system you can use to track changes in
your files. You can work on all types of projects in Git, from small to large.

With Git, you can add changes to your code and then commit them (or save them) when
you're ready. This means you can also go back to changes you made before.

What is GitHub?

GitHub is a web interface where you store your Git repositories and track and manage your
changes effectively. It gives access to the code to various developers working on the same
project. You can make your own changes to a project at the same time as other developers are
making theirs.

If you accidentally mess up some code in your project while making changes, you can easily
go back to the previous stage where the mess has not occurred yet.

How to Setup Git

 To start using Git, you'll need to download it to your computer if you haven't already.
You can do this by going to their official website.
 When Git opens, scroll down a bit and you should see a download button. Go ahead
and click on it.
 Download button on the Git website
 Choose your operating system whether it's Windows, MacOS, Linux/Unix. In my
case, I will be choosing the Windows option because I am using a Windows computer.
 Choose your operating see your system
 Click on the first link at the very top of the page to download the latest version of Git.
 Download the latest version of Git by clicking the first link
 When the download is complete, then go ahead and install Git to your computer.
You'll need to go to the location where the file has been downloaded and install it.
 After the installation, you'll want to make sure that Git is successfully installed on
your system. Open your command prompt or Git bash (whichever one you choose to
use) and run the command

How to Configure Git

Now that we have installed Git on our computer, we have to configure it. We do this so that
any time we are working in a team on a project, we can easily identify the commits we have
made in the repository.

To configure Git, we need to specify the name, email address, and branch by using the git
config --global command. For example:

Create a GitHub Repository

1. Go to GitHub and sign in.

2. Click the New button to create a new repository.

3. Fill out the repository name and other details (public/private), then click Create
Repository.

After creating the repository, GitHub will provide you with the repository URL, such
as:

https://github.com/username/repository-name.git

Creating a file
 Open C or D drive and create a new folder with some name
 In new folder, create any file (txt or word or pdf)

Steps for uploading file from local system to GitHub through Git

Step 1: Initialize Git in Your Local Directory

1. Navigate to your project folder on your local system using the terminal or command
prompt:

cd /path/to/your/project

2. Initialize Git in this folder if it's not already a Git repository:

git init

Step 2: Add Files to Git Tracking

To transfer a specific file from your local system to GitHub:

1. Copy the file to your project folder (if it’s not already there).

2. Add the file to Git's staging area:

git add filename.extension

Step 3: Commit the Changes

After adding the file(s) to the staging area, commit the changes:

git commit -m "first commit"

Step 4: create branch using following command

git branch -M main

Step 5: Add Remote GitHub Repository

Tell Git where your remote GitHub repository is by adding the remote URL:

git remote add origin https://github.com/username/repository-name.git

Step 6: Push the Changes to GitHub

Now push your commit to the GitHub repository:

git push -u origin main


If you're using a different branch (e.g., main instead of master), push using:

git push -u origin main

Step 9: Verify on GitHub

Go to your repository on GitHub, and you should see the file(s) you uploaded listed.

Example:

here ex is folder, ani is text file, repository is gitex

After executing above command file is successfully uploading in repository in GitHub

You might also like