Skip to content

Deploying to Subdomain - Issue with Git Deployment - fails to update repo #285

@hwong0305

Description

@hwong0305

The server has issues with upgrading the repo if user forgets to install express prior to pushing to server.

Duplication Steps:

  1. Clone Subdomain Repo to Local Computer
  2. Create server.js file with Express
  3. Update package.JSON to add start script.
  4. Add and commit changes to Git.
  5. Push to server.
  6. Run npm install express
  7. Add and commit to changes
  8. Push to server
sfwong445@sfwong445~/P/hello.n00b.city> git push origin master
Enumerating objects: 394, done.
Counting objects: 100% (394/394), done.
Delta compression using up to 4 threads
Compressing objects: 100% (381/381), done.
Writing objects: 100% (392/392), 559.60 KiB | 7.67 MiB/s, done.
Total 392 (delta 75), reused 0 (delta 0)
remote: Resolving deltas: 100% (75/75), completed with 1 local object.
remote: Switched to a new branch 'prod'
remote: D	app.js
remote: D	deploy.config.js
remote: D	package.json
remote: HEAD is now at b04e489 v1
remote: error: The following untracked working tree files would be overwritten by checkout:
remote: 	package-lock.json
remote: Please move or remove them before you switch branches.
remote: Aborting
remote: error: Cannot delete branch 'prod' checked out at '/home/myproxy/hello.n00b.city'
remote: npm WARN [email protected] No description
remote:
remote: up to date in 0.317s
remote: found 0 vulnerabilities
remote:
remote: [PM2] Applying action restartProcessId on app [hello.n00b.city](ids: [ 1 ])
remote: [PM2] [hello.n00b.city](1) ✓
remote: ┌────┬─────────────────────────┬─────────┬─────────┬──────────┬────────┬──────┬──────────┬──────────┬──────────┬──────────┬──────────┐
remote: │ id │ name                    │ version │ mode    │ pid      │ uptime │ ↺    │ status   │ cpu      │ mem      │ user     │ watching │
remote: ├────┼─────────────────────────┼─────────┼─────────┼──────────┼────────┼──────┼──────────┼──────────┼──────────┼──────────┼──────────┤
remote: │ 1  │ hello.n00b.city         │ N/A     │ cluster │ 18638    │ 0s     │ 1    │ online   │ 0%       │ 28.7mb   │ myproxy  │ disabled │
remote: │ 0  │ test.n00b.city          │ N/A     │ cluster │ 18292    │ 2m     │ 2    │ online   │ 0%       │ 41.1mb   │ myproxy  │ disabled │
remote: └────┴─────────────────────────┴─────────┴─────────┴──────────┴────────┴──────┴──────────┴──────────┴──────────┴──────────┴──────────┘
To n00b.city:/home/myproxy/hello.n00b.city
   b04e489..783928c  master -> master

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions