4.7 KiB
4.7 KiB
Pushing to Gitea - Setup Instructions
This guide will help you push the InvenTree Stock Tool repository to your internal Gitea server.
Prerequisites
- Git installed on your machine
- Access to your internal Gitea server
- Gitea account with repository creation permissions
Step 1: Create Repository on Gitea
- Log into your Gitea instance
- Click the + button (top right) or go to New Repository
- Fill in the repository details:
- Repository Name:
inventree-stock-tool(or your preferred name) - Description: "Barcode scanning application for InvenTree inventory management"
- Visibility: Choose Private or Public as appropriate
- Initialize Repository: Leave UNCHECKED (we already have a repo)
- Repository Name:
- Click Create Repository
Step 2: Add Gitea as Remote
After creating the repository, Gitea will show you the repository URL. It will look something like:
https://gitea.yourcompany.com/username/inventree-stock-tool.git
Add this as a remote to your local repository:
cd "C:\Users\berwn\Desktop\barcodes\stocktool"
# Add Gitea as remote origin
git remote add origin https://gitea.yourcompany.com/username/inventree-stock-tool.git
# Verify the remote was added
git remote -v
Step 3: Push to Gitea
Push your code to the Gitea server:
# Push master branch to origin
git push -u origin master
You may be prompted for your Gitea username and password.
Alternative: Using SSH
If you prefer SSH over HTTPS:
- Add your SSH key to Gitea (Settings > SSH Keys)
- Use the SSH URL instead:
git remote add origin git@gitea.yourcompany.com:username/inventree-stock-tool.git git push -u origin master
Step 4: Verify Upload
- Go to your Gitea repository in your browser
- You should see all files:
stock_tool_gui_v2.pyREADME.mdFIXES_APPLIED.md.gitignoreexample_config.yaml- Test files
- The README should be displayed on the repository homepage
Step 5: Setup Repository Settings (Optional)
Add Topics/Tags
In Gitea, add relevant topics to help others find the repository:
inventreebarcode-scannerinventory-managementpythontkinter
Branch Protection (Recommended)
If multiple people will be working on this:
- Go to Settings > Branches
- Add protection to
masterbranch - Enable "Require pull request reviews before merging"
Setup Collaborators
- Go to Settings > Collaborators
- Add team members who need access
- Set appropriate permissions (Read, Write, Admin)
Future Updates
After making changes to the code:
# Check what changed
git status
# Add changed files
git add stock_tool_gui_v2.py
# Commit with descriptive message
git commit -m "Fix: Corrected API endpoint for stock updates"
# Push to Gitea
git push origin master
Quick Reference Commands
# Clone from Gitea (for other team members)
git clone https://gitea.yourcompany.com/username/inventree-stock-tool.git
# Pull latest changes
git pull origin master
# Create a new branch for features
git checkout -b feature/new-feature
git push -u origin feature/new-feature
# View commit history
git log --oneline
# View repository info
git remote show origin
Troubleshooting
Authentication Issues
If you have trouble authenticating:
- HTTPS: Use personal access token instead of password (Settings > Applications > Generate Token)
- SSH: Ensure your SSH key is added to Gitea
Push Rejected
If push is rejected:
# Pull changes first
git pull origin master --rebase
# Then push
git push origin master
Large Files Warning
The .gitignore is configured to exclude:
- Python cache files
- Virtual environments
- Config files with credentials (*.yaml except example)
- Log files
Repository Structure
inventree-stock-tool/
├── .gitignore # Git ignore rules
├── README.md # Main documentation
├── FIXES_APPLIED.md # Bug fix documentation
├── GITEA_SETUP.md # This file
├── example_config.yaml # Example configuration
├── stock_tool_gui_v2.py # Main application
├── test_add_stock.py # Tests
├── test_duplicate_handling.py # Tests
├── test_parse_fix.py # Tests
└── test_stock_level.py # Tests
Next Steps
- Share the repository URL with your team
- Update internal documentation with the Gitea link
- Set up any CI/CD pipelines if needed
- Consider adding issue templates for bug reports
Repository initialized and ready for Gitea!
Current commit: ab0d1ae - Initial commit: InvenTree Stock Tool v2