Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
dist/
dist/
.DS_Store
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

---

## [2.1.1] – 2025-07-08
### Changed
- Updated `test/unit-test-framework.ts` file with version 1.0.0 from [Unit Testing Framework](https://github.com/dlealv/officescripts-unit-test-framework) repository.
- Improved documentation of `git-basics.md` adding additional commands and common use cases.
- Minor corrections in `test/main.ts` file

## [2.1.0] – 2025-06-26

### Added
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ This framework is designed to work seamlessly in both Node.js/TypeScript environ

- **Tested Environments:**
- Node.js/TypeScript (VSCode)
- Office Scripts (Excel on the web)
- Office Scripts (Excel)

- **Usage in Office Scripts:**
To use the framework in Office Scripts, just paste the `dist/logger.ts` file at the beginning of your script. If you want to run all tests, then you need to paste the source files into your script in the following order:
Expand All @@ -349,7 +349,7 @@ This framework is designed to work seamlessly in both Node.js/TypeScript environ
The order matters because Office Scripts requires that all objects and functions are declared before they are used.

- **Office Scripts Compatibility Adjustments:**
- The code avoids unsupported keywords such as `any`, `export`, and `import`.
- The code avoids unsupported keywords such as `any`, `require`, `export`, and `import`.
- Office Scripts does not allow calling `ExcelScript` API methods on Office objects inside class constructors; the code is structured to comply with this limitation.
- Office Scripts doesn't allow defining static properties that are functions. For example, `shortFormatterFun` must be defined outside the class.
- Additional nuances and workarounds are documented in the source code comments.
Expand Down Expand Up @@ -410,9 +410,10 @@ This ensures the logging framework is robust and reliable across both developmen
## Additional Information

- For developer setup, testing, or CI details, see [docs/DEVELOPER_GUIDE.md](docs/DEVELOPER_GUIDE.md)
- For debug setup, see [VSCode Debugging.md](docs/VSCode%20Debugging.md)
- TypeDoc documentation: [TYPEDOC](docs/typedoc/index.html)
- Git basic documentation: [git-basics](docs/git-basics.md)
- For debug setup, see [docs/VSCode Debugging.md](docs/VSCode%20Debugging.md)
- TypeDoc documentation: [TYPEDOC](https://dlealv.github.io/officescripts-logging-framework/typedoc/)
- Git basic documentation: [docs/git-basics](docs/git-basics.md)
- Unit testing framework repository: [officescripts-unit-test-framework](https://github.com/dlealv/officescripts-unit-test-framework) from the same author. Used for testing current repository. Check repository's details for more information.

## License

Expand Down
Binary file modified docs/.DS_Store
Binary file not shown.
152 changes: 121 additions & 31 deletions docs/git-basics.md
Original file line number Diff line number Diff line change
@@ -1,94 +1,184 @@
# Git Basic Operations Reference

A concise cheat sheet with essential commands and common workflows for daily Git usage.
**Tip:** Use `git help <command>` for detailed info about any command!

---

## 1. Setup

```bash
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --global core.editor "code --wait" # Set VSCode as editor (optional)
```

---

## 2. Creating a Repository

```bash
git init # Initialize new repo in current directory
git clone <url> # Clone an existing repository
```

---

## 3. Checking Status

```bash
git status # Show status of changes
```

---

## 4. Staging and Committing
- **Stagging**: Moves changes from your working directory to the staging area, preparing them for the next commit
- **Committing**: Captures a snapshot of the currently staged changes and records them in the local repository

- **Staging**: Moves changes from your working directory to the staging area.
- **Committing**: Captures a snapshot of the currently staged changes.

```bash
git add <file> # Stage a specific file
git add . # Stage all files
git add . # Stage all files (including new, modified, deleted)
git commit -m "Message" # Commit staged changes
git commit --allow-empty -m "Message" # A commit with no changes
git commit --allow-empty -m "Message" # Commit with no changes (create marker)
```

---

## 5. Viewing History

```bash
git log # View commit history
git log --oneline # Condensed log
git log # View commit history
git log --oneline # Condensed log (one commit per line)
git log -p <file> # Show changes for a file over time
git diff <commit> <commit> # Show differences between two commits
```

---

## 6. Working with Branches

```bash
git branch # List branches
git branch <name> # Create new branch
git checkout <name> # Switch to branch
git checkout -b <name> # Create and switch to branch
git merge <name> # Merge branch into current
git branch -d <name> # Delete a branch
git branch # List branches
git branch <name> # Create new branch
git checkout <name> # Switch to branch
git checkout -b <name> # Create and switch to branch
git merge <name> # Merge branch into current
git branch -d <name> # Delete a branch
git branch -m <old> <new> # Rename a branch
```

---

## 7. Pulling and Pushing
- **Pulling**: Fetches changes from a remote repository and integrates them into your local branch
- **Pushing**: Upload local repository content to a remote repository

- **Pulling**: Fetches changes from a remote repository and integrates them into your local branch.
- **Pushing**: Uploads local commits to a remote repository.

```bash
git pull # Fetch and merge from remote
git push # Push changes to remote
git push -u origin <branch> # Push new branch and track
git pull # Fetch and merge from remote (default remote/branch)
git pull origin main # Fetch and merge changes from 'main' on 'origin'
git push # Push changes to remote (current branch)
git push -u origin <branch> # Push new branch and set upstream tracking
```
**Note**: `origin` is the default name of the remote repository on GitHub.

---

## 8. Undoing Changes

```bash
git checkout -- <file> # Discard changes in working directory
git reset HEAD <file> # Unstage a file
git revert <commit> # Create a new commit to undo changes
git reset --hard <commit> # Reset history and working directory (danger!)
git checkout -- <file> # Discard local changes in working directory (before staging)
git reset HEAD <file> # Unstage a file (keep changes in working directory)
git revert <commit> # Create new commit to undo changes (safe, doesn't rewrite history)
git reset --hard <commit> # Danger! Discard ALL history and changes since <commit>
```

---

## 9. Tags

```bash
git tag # List tags
git tag <name> # Create tag
git push origin <tag> # Push tag to remote
git tag # List tags
git tag <name> # Create tag at current commit
git tag -a <name> -m "msg" # Annotated tag with message
git push origin <tag> # Push tag to remote
git push origin --tags # Push all tags to remote
```

---

## 10. Rebasing (Advanced)
Modify the commit history of a branch by moving or combining a sequence of commits to a new base commit

- Modify the commit history of a branch by moving or combining a sequence of commits to a new base commit.

```bash
git rebase <base-branch> # Rebase current branch onto base
git rebase -i <commit-hash> # Interactive rebase for editing history
git rebase <base-branch> # Rebase current branch onto base
git rebase -i <commit-hash> # Interactive rebase for editing history
```

---

## 11. Stashing
Allows temporarily save uncommitted changes

- Temporarily save uncommitted changes.

```bash
git stash # Stash unsaved changes
git stash pop # Apply and remove latest stash
git stash list # List all stashes
git stash apply stash@{n} # Apply specific stash (keeps it in stash list)
```

---

## 12. Common Multi-Step Workflows

### A. Sync local repo with remote (bring latest changes)

```bash
git checkout main
git pull origin main
```

### B. Create and work on a new feature branch

```bash
git checkout main
git pull origin main # Make sure main is up to date
git checkout -b my-feature # Create and switch to new branch
# ...edit files...
git add .
git commit -m "Implement feature"
git push -u origin my-feature # Push branch and set upstream
```

### C. Merge a finished feature branch into main

```bash
git checkout main
git pull origin main # Update local main
git merge my-feature
git push origin main # Push merged changes
```

### D. Update your feature branch with latest main

```bash
git checkout my-feature
git pull origin main # Merge latest main into your branch
```
*(Or use `git rebase origin/main` if rebasing is preferred)*

### E. Delete a merged feature branch (locally and remotely)

```bash
git stash # Stash unsaved changes
git stash pop # Apply stashed changes
git branch -d my-feature # Delete local branch
git push origin --delete my-feature # Delete remote branch
```

---

**Tip:**
Use `git help <command>` for detailed info about any command!
Use `git help <command>` for detailed info about any command!
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "officescripts-logging-framework",
"version": "2.1",
"version": "2.1.1",
"description": "Lightweight, extensible logging framework for Office Scripts, inspired by libraries like Log4j. Enables structured logging via a singleton 'Logger', supporting multiple log levels ('Logger.LEVEL') and pluggable output targets through the 'Appender' interface",
"main": "index.js",
"directories": {
Expand Down
Loading