Angular5集成Angular-CLI后App文件夹无法上传至BitBucket
Hey there, let's work through why your app folder isn't making it to BitBucket! As someone new to Angular-CLI and Git workflows, this is a totally common hiccup—let's break it down step by step.
Possible Causes & Fixes
1. Check Your .gitignore File
The most likely culprit is that your main repo's .gitignore has a rule excluding the app folder. Angular-CLI's default .gitignore doesn't exclude app, but if the main repo you cloned had existing rules, they might be blocking it:
- Open the
.gitignorefile in your project root. - Search for lines like
app/,/app, orsrc/app/(depending on where your app folder lives). - If you find any of these, delete the line or comment it out by adding a
#at the start (e.g.,# app/).
2. Ensure the App Folder is Tracked by Git
Git only pushes files it's been told to track. If you merged the Angular project files but never added the app folder to Git, it won't push:
- Open your terminal in the project root.
- Run
git status—look forapp/listed underUntracked files. - If it's there, run these commands:
git add app/ # Use `git add src/app/` if your app lives inside a src folder git commit -m "Add custom Angular app folder and components" git push
3. Fix Git Caching Issues (If the Above Fails)
Sometimes Git gets confused with cached ignore rules. If the app folder exists locally but still won't push, reset the cache for that folder:
- Run these commands in order:
git rm -r --cached app/ # Or src/app/ if needed git add app/ git commit -m "Fix cached tracking for app folder" git push
4. Verify the Merge Worked Correctly
Double-check that the app folder actually exists in your local branch:
- Use
ls(macOS/Linux) ordir(Windows) in the project root to confirm the folder is present, with all your custom components inside. - If the folder is missing, you might need to re-do the merge step to copy the Angular project files into your branch properly.
内容的提问来源于stack exchange,提问作者kkom

