You are here:
Vanderbilt Biostatistics Wiki
>
Main Web
>
TWikiUsers
>
DalePlummer
>
DalesNotes
>
PSNoteRegardingGit
(12 Feb 2021,
DalePlummer
)
(raw view)
E
dit
A
ttach
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). <verbatim> 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") </verbatim> Then I did =git add= to add these new and changed files to stage the files for commit. <verbatim> 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 </verbatim> Then =git status= looked like this. Not the "Changes to be committed" list. <verbatim> 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 </verbatim> Then commit the staged changes. <verbatim> 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$ </verbatim> =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. <verbatim> 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") </verbatim> Now =git push= the changes to the github repository. <verbatim> 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$ </verbatim> One more =git status=. Note that it now says "Your branch is up to date with 'origin/master'". <verbatim> 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") </verbatim>
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Edit
w
iki text
|
M
ore topic actions
Topic revision: r1 - 12 Feb 2021,
DalePlummer
Main
Department Home Page
Biostatistics Graduate Program
Vanderbilt University Medical Center
Main Web
Main Web Home
Search
Recent Changes
Changes
Topic list
Biostatistics Webs
Archive
Main
Sandbox
System
Register
|
Log In
Copyright © 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