Here are some notes regarding what to commit after working on code and running npm run build

Here is git status output. In this example, I had already committed some code (e.g. *.R, *.ts, *.html, etc.). If I had not already done that, those files would appear here as modified or in the untracked list (if new).
dalep@biostat1468:~/ps$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   inst/angular/dist/ps/index.html
        deleted:    inst/angular/dist/ps/main-es2015.069db1b36c9ed1051863.js
        deleted:    inst/angular/dist/ps/main-es5.069db1b36c9ed1051863.js
        deleted:    inst/angular/dist/ps/main-es5.f1b10667f2ebb1e98c3e.js
        modified:   inst/angular/src/app/version.ts

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        R/ssize.R
        inst/angular/dist/ps/main-es2015.aa9e8432ff8bd573cb82.js
        inst/angular/dist/ps/main-es5.aa9e8432ff8bd573cb82.js
        run-backend-demo.R
        x.sh

no changes added to commit (use "git add" and/or "git commit -a")

Then I did git add to add these new and changed files to stage the files for commit.
dalep@biostat1468:~/ps$ git add inst/angular/dist/ps/index.html
dalep@biostat1468:~/ps$ git add inst/angular/src/app/version.ts
dalep@biostat1468:~/ps$ git add inst/angular/dist/ps/main-es2015.aa9e8432ff8bd573cb82.js
dalep@biostat1468:~/ps$ git add inst/angular/dist/ps/main-es5.aa9e8432ff8bd573cb82.js

Then git status looked like this. Not the "Changes to be committed" list.
dalep@biostat1468:~/ps$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        modified:   inst/angular/dist/ps/index.html
        new file:   inst/angular/dist/ps/main-es2015.aa9e8432ff8bd573cb82.js
        new file:   inst/angular/dist/ps/main-es5.aa9e8432ff8bd573cb82.js
        modified:   inst/angular/src/app/version.ts

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        deleted:    inst/angular/dist/ps/main-es2015.069db1b36c9ed1051863.js
        deleted:    inst/angular/dist/ps/main-es5.069db1b36c9ed1051863.js
        deleted:    inst/angular/dist/ps/main-es5.f1b10667f2ebb1e98c3e.js

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        R/ssize.R
        run-backend-demo.R
        x.sh

Then commit the staged changes.
dalep@biostat1468:~/ps$ git commit -m "after npm run build"
[master dee0e2e] after npm run build
 4 files changed, 5 insertions(+), 3 deletions(-)
 create mode 100644 inst/angular/dist/ps/main-es2015.aa9e8432ff8bd573cb82.js
 create mode 100644 inst/angular/dist/ps/main-es5.aa9e8432ff8bd573cb82.js
dalep@biostat1468:~/ps$

git status now reports this. Note the "Your branch is ahead of 'origin/master' by 2 commits". That mean my local repository is ahead of the repo on github. Need to push the changes.
dalep@biostat1468:~/ps$
dalep@biostat1468:~/ps$ git status
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
  (use "git push" to publish your local commits)

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        deleted:    inst/angular/dist/ps/main-es2015.069db1b36c9ed1051863.js
        deleted:    inst/angular/dist/ps/main-es5.069db1b36c9ed1051863.js
        deleted:    inst/angular/dist/ps/main-es5.f1b10667f2ebb1e98c3e.js

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        R/ssize.R
        run-backend-demo.R
        x.sh

no changes added to commit (use "git add" and/or "git commit -a")

Now git push the changes to the github repository.
dalep@biostat1468:~/ps$ git push
Username for 'https://github.com': dale.plummer@vumc.org
Password for 'https://dale.plummer@vumc.org@github.com':
Counting objects: 24, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (20/20), done.
Writing objects: 100% (24/24), 391.49 KiB | 5.22 MiB/s, done.
Total 24 (delta 14), reused 0 (delta 0)
remote: Resolving deltas: 100% (14/14), completed with 6 local objects.
remote:
remote: GitHub found 1 vulnerability on vubiostat/ps's default branch (1 moderate). To find out more, visit:
remote:      https://github.com/vubiostat/ps/security/dependabot/inst/angular/package-lock.json/socket.io/open
remote:
To https://github.com/vubiostat/ps.git
   f6dd3ec..dee0e2e  master -> master
dalep@biostat1468:~/ps$

One more git status. Note that it now says "Your branch is up to date with 'origin/master'".
dalep@biostat1468:~/ps$
dalep@biostat1468:~/ps$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        deleted:    inst/angular/dist/ps/main-es2015.069db1b36c9ed1051863.js
        deleted:    inst/angular/dist/ps/main-es5.069db1b36c9ed1051863.js
        deleted:    inst/angular/dist/ps/main-es5.f1b10667f2ebb1e98c3e.js

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        R/ssize.R
        run-backend-demo.R
        x.sh

no changes added to commit (use "git add" and/or "git commit -a")
Topic revision: r1 - 12 Feb 2021, DalePlummer
 

This site is powered by FoswikiCopyright © 2013-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Vanderbilt Biostatistics Wiki? Send feedback