Go back to Fan’s Tex4Econ and Miscellaneous Repository.
# show all remote url
git remote -v
Check if a particular file has had local changes that have not been commited yet.
Use the git status command, with short -s option:
spg_modified <-
paste0('git status -s',
'C:/Users/fan/R4Econ/amto/array/fs_ary_mesh.Rmd')
spg_anewfile <-
paste0('git status -s',
'C:/Users/fan/R4Econ/math/differentiation/fs_differentiate_lhopital.Rmd')
spg_nochange <-
paste0('git status -s',
'C:/Users/fan/R4Econ/math/func_ineq/fs_atkinson_ces.Rmd')
st_git_status <- toString(system(spg_modified, intern=TRUE))
grepl(' M ', st_git_status, fixed=TRUE)
grepl('?? ', st_git_status, fixed=TRUE)
(st_git_status == "")
st_git_status <- toString(system(spg_anewfile, intern=TRUE))
grepl(' M ', st_git_status, fixed=TRUE)
grepl('?? ', st_git_status, fixed=TRUE)
(st_git_status == "")
st_git_status <- toString(system(spg_nochange, intern=TRUE))
grepl(' M ', st_git_status, fixed=TRUE)
grepl('?? ', st_git_status, fixed=TRUE)
(st_git_status == "")