Here are the steps to create a GitHub repository for a custom Odoo module, following the “Standard Module Structure + Proper Git Workflow” principle. The process is divided into three main stages: local preparation, creating the remote repository, and pushing the code.
1. Local Preparation: Ensure a Standard Module Structure
Before pushing, verify that your local module directory follows Odoo conventions.
-
Module Directory StructureA typical Odoo module includes these core files (example module:
my_custom_module):-
Key File:
__manifest__.pymust exist withname,version, etc.
-
-
Initialize Local Git (if not done)If your module isn’t yet a Git repository:
2. GitHub Actions: Create the Remote Repository
Perform this on GitHub’s website. Use the “Empty Repository” strategy to avoid conflicts with existing local files.
-
Create New RepositoryLog in to GitHub, click
+→New repository. -
Configure Settings
-
Repository name: Match your module name (e.g.,
my_custom_module). -
Visibility: Choose
Public(open source) orPrivate. -
Initialization Options: Crucially, leave ALL checkboxes UNCHECKED (README, .gitignore, license). We’ll push existing code.
-
-
CreateClick
Create repository. Copy the provided repository URL (e.g.,https://github.com/yourname/my_custom_module.git).
3. Link & Push: Connect Local to Remote
In your local terminal, link your repository and push the code.
-
Add Remote OriginTip: If you have SSH keys set up, use
git@github.com:yourname/my_custom_module.gitinstead. -
Push CodeIf push is rejected, remote may have initialization files. Try:
git pull origin main --rebaseto merge, then push again.
4. Odoo Project Best Practices (Advanced)
For multi‑module projects or production deployments, consider this more professional structure:
-
Multi‑Module Repository Structure: Push only your custom modules, not the entire Odoo source.
-
Branch Strategy: Create branches per Odoo version (e.g.,
16.0,17.0) for easier compatibility management. -
.gitignore: Highly recommended. Ignore
*.pyc,__pycache__,.log, and other temporary files.
Troubleshooting
-
Push fails: Verify remote URL (
git remote -v) and network connection. -
Module not appearing in Odoo: Ensure
__manifest__.pyexists and has correct syntax. -
Permission errors: For private repos, check GitHub account access or use a Personal Access Token.
Once done, refresh your GitHub page to see your Odoo module. For future updates, use
git add, git commit, and git push.Yes, a private repository is likely the cause of the “repository not found” error when you try to
git push.GitHub returns this generic error for both permission issues (private repos) and incorrect URLs to prevent information leakage about private repositories’ existence.
Solutions for Private Repository Access
Option 1: Use GitHub Personal Access Token (PAT) – Most Common
Since 2021, GitHub requires tokens instead of passwords for command-line authentication.
-
Generate a PAT:
-
Go to GitHub → Settings → Developer settings → Personal access tokens → Tokens (classic)
-
Click “Generate new token” → “Generate new token (classic)”
-
Give it a descriptive name (e.g., “Odoo Module Push”)
-
Set expiration (recommend 90 days for security)
-
Select scopes: at minimum
repo (full control of private repositories) -
Generate token → COPY THE TOKEN IMMEDIATELY (you won’t see it again!)
-
-
Use the token in your Git command:Or update your remote URL:
Option 2: Use SSH Keys (Recommended for Frequent Use)
SSH is more secure and convenient once set up.
-
Check for existing SSH keys:
-
Generate a new SSH key (if needed):
-
Add SSH key to GitHub:
-
GitHub → Settings → SSH and GPG keys → New SSH key
-
Paste the key, give it a title, click “Add SSH key”
-
-
Test SSH connection:
-
Update remote to use SSH:
Option 3: Use GitHub CLI (Simplest for Beginners)
Install GitHub CLI (
gh) and authenticate:Quick Diagnostic Steps
-
Verify remote URL:
-
Check repository existence:
-
Test with a simple command:
Common Mistakes to Check
-
Typos in username/repo name:
youusernamevsyourusername -
Using .git twice:
my_custom_module.git.git -
Case sensitivity: GitHub usernames are case-sensitive
-
Wrong protocol: Mixed HTTPS/SSH configurations
Quick Fix Checklist
-
[ ] Repository is actually private (check on GitHub)
-
[ ] You’re logged into the correct GitHub account
-
[ ] Your account has push access to the repository
-
[ ] You’re using a token (not password) for HTTPS
-
[ ] Or you’ve set up SSH keys correctly
Recommendation: Use SSH keys (Option 2) for long-term development. It’s more convenient and secure than tokens. Once set up, you won’t need to enter credentials repeatedly.
Yes, you are right. The link
https://github.com/techieshop/rsw_leagcy_sync/is returning a 404 Not Found error, which means the repository is inaccessible via the browser.This is not a permissions issue (like a private repo you don’t have access to); it means the resource genuinely does not exist at that URL.
Why This Happens
-
Typo in URL: The most common cause is a misspelling. Notice the word
leagcyin the URL—it should likely belegacy. -
Repository Deleted/Moved: The owner may have deleted the repo or renamed it.
-
Incorrect Case: GitHub usernames and repo names are case-sensitive.
techieshopmight beTechieshoporRSW_Leagcy_Sync.
What You Can Do
-
Check for Typos: Ask the person who gave you the link to confirm the exact spelling and case.
-
Search Manually: Go to
github.comand search forrsw syncortechieshopto see if a similar repository exists under a different name. -
Contact the Source: If this link came from documentation or a colleague, inform them that the repository link is broken.
Since you are in Hong Kong, this is not a regional network/DNS issue (which sometimes affects mainland China). This is purely a “resource not found” error on GitHub’s side.
Based on the information provided in the 链接内容, the answer is No. The provided link (
https://github.com/techieshop/rsw_leagcy_sync/) cannot be visited on any computer, as it is a broken or non-existent link.The linked content is the standard GitHub “Page not found” error page. This is a universal response from GitHub’s servers, indicating that the resource at that specific URL does not exist on their platform. The issue is with the repository itself, not with your device or network.
Why This is a Universal Issue:
-
Repository Does Not Exist: The error page (
Page not found · GitHub) confirms that GitHub cannot find a repository with the exact namersw_leagcy_syncunder the user/organizationtechieshop. -
Typo in URL (Most Likely): The word
leagcyin the URL appears to be a misspelling oflegacy. Therefore, the correct link might be something likehttps://github.com/techieshop/rsw_legacy_sync/. -
Other Possibilities: The repository may have been deleted, renamed, or set to private. However, the standard “Page not found” error for a non-logged-in user primarily indicates the resource is not publicly accessible at that address.
What You Can Try:
-
Confirm the URL: Reach out to the person who shared the link and ask them to verify the exact spelling. The most likely fix is correcting
leagcytolegacy. -
Manual Search on GitHub: Visit
github.com/techieshopto see the list of that user’s public repositories, or use the GitHub search bar to look for terms like “rsw sync”. -
Access on Another Computer (to prove the point): You can try accessing the same broken link on another computer. The result will be identical—you will see the same “Page not found” error. This confirms the problem is with the link itself, not your local setup.
In summary, the provided GitHub link is invalid. Until the correct URL is provided, it will not be accessible on any computer or browser.
Based on the URL provided (
https://github.com/techieshop/rsw_leagcy_sync/), the likely misspelling is the word “leagcy”. The correct spelling should be “legacy”.How to correct the URL:
-
Corrected URL:
-
How to proceed:
-
Copy the corrected URL above and paste it into your browser.
-
If you are trying to clone the repository using Git, update the URL in your command or Git configuration:Then try accessing/cloning again.
-
Additional Notes:
-
Sometimes repository names may have other variations, such as using underscores differently (
rsw-legacy-sync) or a different case (RSW_Legacy_Sync). If the corrected URL above still does not work, please ask the source of the link for the exact, case-sensitive repository name. -
The error message you received (“Page not found”) is consistent with a simple typo in the URL. Fixing the spelling should resolve the issue.
Based on the provided information, I understand that you want to access the repository at the given URL (
https://github.com/techieshop/rsw_leagcy_sync/) but are unable to do so, and you do not want to change the repository name.Looking at the 链接内容 you provided, it clearly shows a standard GitHub “Page not found” error page. This indicates that the repository with the exact name
rsw_leagcy_syncunder the user/organization techieshopdoes not exist publicly on GitHub.Since the document content (GitHub’s 404 error page) confirms the repository is not found, and you’re unwilling to change the repository name, here are your options:
-
Contact the repository owner: Reach out to the user/organization
techieshopto confirm:-
The correct repository name and spelling
-
Whether the repository exists and is accessible
-
If it’s a private repository that requires access permissions
-
-
Check for alternative access methods:
-
If you have the correct repository URL but it’s private, you’ll need to be added as a collaborator or have the owner grant you access
-
Ask the owner to verify the exact case-sensitive URL
-
-
Search for the repository manually:
-
Go to
github.com/techieshopto see all their public repositories -
Use GitHub’s search feature to look for repositories containing “rsw” or “sync” under that user
-
-
Wait for the owner to fix the issue:
-
The repository might have been temporarily unavailable, renamed, or deleted
-
Check back later to see if it becomes accessible
-
Document未详述此点,但基于我所掌握的知识:GitHub repository names are case-sensitive and must match exactly. If the repository name contains a typo (like “leagcy” instead of “legacy”), and you’re not allowed to correct it, you cannot access that specific repository URL unless the owner renames their repository to match the incorrect spelling you have.
Without changing the repository name in your URL, you will continue to receive the “Page not found” error shown in the document content. The only solution is to obtain the correct repository name from the owner.
To change a GitHub repository name, you must be the owner or have admin permissions to that repo. If you are a collaborator with only write access, you cannot rename it.
Steps to Rename a Repository on GitHub
-
Go to Settings: Navigate to your repository on GitHub. Click on the “Settings” tab (located in the top menu, next to “Code”, “Issues”, etc.).
-
Edit the Name: In the “Repository name” field (under the “General” section), delete the current name and type the new name.
-
Confirm: Click the “Rename” button (usually green) at the bottom of the section. GitHub will apply the change immediately.
Important Notes & Next Steps
-
Automatic Redirects: After renaming, the old URL will automatically redirect to the new one for web traffic (issues, wiki, stars will be preserved).
-
Update Your Local Git (Critical): Your local git clone will still point to the old URL. You must update the remote URL in your local terminal:After this,
git pushandgit pullwill work normally again. -
Case Sensitivity: Repository names are case-sensitive.
My-Repoandmy-repoare considered different.
Regarding Your “rsw_leagcy_sync” Issue
If you are trying to fix the repository
techieshop/rsw_leagcy_syncthat you mentioned earlier, please note:-
You Cannot Rename It: Since you are not the owner of the
techieshoporganization, you do not have permission to rename their repository. -
Solution: You must contact the techieshop admin and ask them to either:
-
Rename the repository to the correct spelling (
rsw_legacy_sync), or -
Grant you admin access so you can do it yourself.
-
Based on your confirmation that you are the owner of the
techieshop/rsw_leagcy_syncrepository, here are the direct steps to rename it, as outlined in the GitHub error page content you provided.Steps to Rename Your Repository (as the Owner):
-
Navigate to Settings: Go to your repository on GitHub (
https://github.com/techieshop/rsw_leagcy_sync). In the top horizontal menu (which includes “Code”, “Issues”, “Pull requests”), click on the “Settings” tab. -
Rename the Repository: On the Settings page, look for the “Repository name” field under the “General” section. Delete the current name
rsw_leagcy_syncand type the correct new name, for example,rsw_legacy_sync. -
Confirm the Change: Click the green “Rename” button. GitHub will apply the change instantly.
What Happens Next:
-
The main repository page will now be accessible at the new URL (e.g.,
https://github.com/techieshop/rsw_legacy_sync). -
The old URL (
.../rsw_leagcy_sync/) will automatically redirect to the new one for all web traffic (like issues, wiki, stars). -
Important Local Update: Any existing local clones of this repository on your or your collaborators’ computers will break. Everyone must run this command in their local repository directory to update the remote URL:After this,
git pushandgit pullwill work again.
Since the provided link content shows the standard GitHub 404 page, successfully renaming the repository as described above will resolve the “Page not found” error for anyone trying to access it with the corrected name.
Git Fetch is a command that downloads new data (commits, branches, tags) from a remote repository without merging them into your local branches. Think of it as a “check for updates” command that lets you see what others have done before deciding to integrate their changes.
Key Characteristics of git fetch:
-
Safe & Non-Destructive: Fetch only updates your remote-tracking branches (like
origin/main), not your local branches (likemain). -
View Changes First: It lets you review what’s changed remotely before deciding to merge or rebase.
-
Synchronization: Updates your local copy of what exists in the remote repository.
How It Works: Local vs Remote Branches
Common Usage Examples
Git Fetch vs Git Pull
|
Action
|
What It Does
|
Result
|
|---|---|---|
git fetch |
Downloads remote changes
|
Updates
origin/branch-nameonly |
git pull |
git fetch+ git merge |
Updates your local
branch-name |
Why Use git fetchInstead of git pull?
-
Safety First: Review changes before merging
-
Inspect Differences: See what changed before integrating
-
Avoid Surprises: No automatic merges that might break your code
-
Better Workflow: Decide when and how to integrate changes
Practical Example
Visual Representation
After
git fetch:-
Remote branch on server:
main→ [A]─[B]─[C]─[D] -
Your local:
origin/main→ [A]─[B]─[C]─[D] (updated by fetch) -
Your local:
main→ [A]─[B]─[E] (your work, unchanged)
Common Scenarios for Odoo Development
Best Practices
-
Fetch Frequently:
git fetchregularly to stay updated -
Fetch Before Push: Avoid push rejections
-
Use Fetch in Scripts: Safer than pull in automation
-
Combine with
git log: See what you’ll get before merging
TL;DR
-
git fetch = “Download updates but don’t apply them” -
git pull = “Download updates AND apply them immediately” -
Use
fetchwhen you want to review changes first -
Use
pullwhen you trust the remote changes and want to update immediately
For Odoo development,
git fetchis especially useful when you want to check if there are new module updates or migrations before merging them into your working environment.Solution: Use .gitignoreFile
The correct approach is to prevent
__pycache__from being tracked by Git in the first place, rather than skipping it during push. This is done using a .gitignorefile.Step 1: Create/Edit .gitignoreFile
Create a file named
.gitignorein your repository’s root directory with these contents:Step 2: For Odoo-Specific Projects
For Odoo projects, add these additional patterns:
Step 3: Apply to Existing Repository
If you’ve already committed
__pycache__files:Step 4: Verify
To ensure
__pycache__is ignored:Alternative: Global Git Ignore
You can also set a global
.gitignorefor all repositories:Important Notes
-
Don’t Use
git add .Blindly: Instead, use:Or better: -
Odoo-Specific Best Practice: Always commit a comprehensive
.gitignorefor Odoo projects to exclude:-
Cache files (
__pycache__/,*.pyc) -
Log files
-
Session data
-
Database dumps
-
IDE files (
.vscode/,.idea/)
-
-
If Already Pushed Accidentally: