Skip to content

kahenda/git

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

Git Project Documentation - Kahenda

This is the Hello World example from the git project. (Changed in the original and pushed to shared)

1. Project Overview

This project is a comprehensive dive into Git version control. It covers repository initialization, history management, tagging, branching, and advanced history manipulation through rebasing.

2. Process Followed

Initial Setup & Commits

  • Initialized the repository in the hello directory.
  • Created hello.sh and evolved it from a simple echo to a script that accepts arguments and has default values.
  • Practiced granular commits by splitting comment changes and logic changes into separate commits.

History & Navigation

  • Used git log --oneline and git log --graph to monitor the project tree.
  • Successfully navigated history using git checkout with tags and parent references (v1^).

Branching & Refactoring

  • Created a greet branch for a major rewrite of the "Hello World" functionality.
  • Moved hello.sh into a lib/ directory using git mv and implemented a Makefile to handle the execution logic.
  • Created greeter.sh to demonstrate function sourcing and modularity.

3. Challenges & Solutions

Challenge Solution Lesson Learned
Missing Author Email I forgot to set user.email at the start. I used an interactive rebase: git rebase -i --root --exec "git commit --amend --reset-author --no-edit" to fix the whole history. Setting up global config (user.name and user.email) is the most important first step in any Git project.
Ambiguous Git Push Error Received a "fatal: ambiguous argument" error during a force push after rebasing. I verified the push status with git log and origin/main to ensure the remote was updated despite the warning.
Detached HEAD State When checking out tags, I entered a detached HEAD state. I learned to use git checkout main to safely return to the active branch tip.

4. Key Commands Used

  • Personalized Log: git log --pretty=format:"%h %ad | %s%d [%an]" --date=short
  • Tagging: git tag v1 and git tag v1-beta v1^
  • Rebase: git rebase -i --root
  • Automation: make run (via the created Makefile)

5. Conclusion

This project reinforced the importance of a clean, linear commit history. By using rebasing instead of just creating "fix-up" commits, the final audit trail remains professional and easy to follow for any auditor.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors