Skip to content

About

This repository demonstrates the Git and GitHub workflow used while developing and maintaining the Visitor Management System(CRUD based web application). The objective was to practice version control, repository management, commits, remote repositories, synchronization, and maintaining a clean project history.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

CodSoft Task 2 — Git & GitHub Workflow

Visitor Management System

This repository contains the Git and GitHub workflow demonstrated during the development of the Visitor Management System as part of the CodSoft DevOps Internship — Task 2.

The task focuses on using Git for version control and GitHub for remote repository management, collaboration, synchronization, and automated workflow execution.

Task Objective

The objective of this task was to illustrate:

  • Git repository initialization
  • GitHub repository management
  • Tracking changes with Git
  • Creating commits
  • Working with branches
  • Synchronizing local and remote repositories
  • Handling Git merge/synchronization issues
  • Using .gitignore
  • Implementing a GitHub Actions workflow

Technologies Used

  • Git
  • GitHub
  • GitHub Actions
  • PowerShell
  • Visual Studio Code

Git Workflow

The project followed a standard local-to-remote Git workflow:

Local Project
     |
     v
   Git
     |
     +---- git add
     |
     +---- git commit
     |
     +---- git pull
     |
     +---- git push
     |
     v
   GitHub

Repository Initialization

Git was initialized in the project directory:

git init

The GitHub repository was then configured as the remote repository:

git remote add origin https://github.com/ajmeransari/CODSOFT_TASK2.git

The configured remote can be checked using:

git remote -v

Tracking Project Changes

Repository status was checked using:

git status

Changes were staged using:

git add .

and committed using:

git commit -m "Commit message"

Changes were then pushed to GitHub:

git push

Branching and Synchronization

Git branches were used to understand and manage separate lines of development. The main branch was used for the stable project version. Typical branch commands include:

git branch
git branch <branch-name>
git switch <branch-name>

Remote changes were synchronized with the local repository using:

git pull

The project also encountered a local/remote history synchronization situation, which was resolved before continuing with subsequent pushes.

.gitignore

A .gitignore file was used to prevent unnecessary or sensitive local files from being committed.

Examples include:

venv/
.venv/
__pycache__/
*.pyc
.env

Local environment files and sensitive configuration should not be uploaded to a public repository.

GitHub Actions

A GitHub Actions workflow was added to the repository:

.github/
└── workflows/
    └── ci.yml

The workflow provides automated checks whenever changes are pushed to GitHub.

The CI workflow was later extended to install the project dependencies and run automated tests.

CI Workflow

Git Push
   |
   v
GitHub Actions
   |
   v
Install Dependencies
   |
   v
Run Tests
   |
   v
Result

The automated tests were successfully executed on GitHub Actions.

Testing

The project contains automated tests under:

tests/

Pytest was used to execute the tests:

python -m pytest

The test suite successfully passed locally and through GitHub Actions.

Example result:

2 passed

Useful Git Commands

Check repository status

git status

Stage changes

git add .

Commit changes

git commit -m "Add project changes"

Push changes

git push

Pull remote changes

git pull

View commit history

git log --oneline

View remote repositories

git remote -v

View staged file changes

git diff --cached --name-only

Repository Structure

CODSOFT_TASK2/
│
├── .github/
│   └── workflows/
│       └── ci.yml
│
├── tests/
│   └── test_app.py
│
├── .gitignore
├── README.md
└── Project Files

Security

The repository does not intentionally contain:

  • .env files
  • Database passwords
  • Private keys
  • Local virtual environments
  • Sensitive credentials
  • Private database backups

Sensitive configuration should be stored outside the Git repository or managed through appropriate secret-management mechanisms.

Result

The Visitor Management System was successfully managed using Git and GitHub. The project demonstrated local version control, remote repository synchronization, organized commits, .gitignore usage, and automated testing through GitHub Actions.

About

This repository demonstrates the Git and GitHub workflow used while developing and maintaining the Visitor Management System(CRUD based web application). The objective was to practice version control, repository management, commits, remote repositories, synchronization, and maintaining a clean project history.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors