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.
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
- Git
- GitHub
- GitHub Actions
- PowerShell
- Visual Studio Code
The project followed a standard local-to-remote Git workflow:
Local Project
|
v
Git
|
+---- git add
|
+---- git commit
|
+---- git pull
|
+---- git push
|
v
GitHub
Git was initialized in the project directory:
git initThe GitHub repository was then configured as the remote repository:
git remote add origin https://github.com/ajmeransari/CODSOFT_TASK2.gitThe configured remote can be checked using:
git remote -vRepository status was checked using:
git statusChanges were staged using:
git add .and committed using:
git commit -m "Commit message"Changes were then pushed to GitHub:
git pushGit 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 pullThe project also encountered a local/remote history synchronization situation, which was resolved before continuing with subsequent pushes.
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.
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.
Git Push
|
v
GitHub Actions
|
v
Install Dependencies
|
v
Run Tests
|
v
Result
The automated tests were successfully executed on GitHub Actions.
The project contains automated tests under:
tests/
Pytest was used to execute the tests:
python -m pytestThe test suite successfully passed locally and through GitHub Actions.
Example result:
2 passed
git statusgit add .git commit -m "Add project changes"git pushgit pullgit log --onelinegit remote -vgit diff --cached --name-onlyCODSOFT_TASK2/
│
├── .github/
│ └── workflows/
│ └── ci.yml
│
├── tests/
│ └── test_app.py
│
├── .gitignore
├── README.md
└── Project Files
The repository does not intentionally contain:
.envfiles- 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.
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.