Now that we're using Git for the GitHub repositories, it's quite simple to update the files in the workspace. From the UI, of a user selects the same files/folders again, this is already done for them. But it could be also done from the workspace side of things with something like this:
find all folders in workspace with a .git folder ---these are GitHub repositories
enter these, run git commit -a .. to save the current state
update the files in the repository: run git checkout <branch> * (this may fail if the user has created new files that are not tracked by the repo, though, not sure if there's a way around this---we could just show a message with "failed, you probably have modified files in there" or something like that)
git commit -a
The only issue I see here is that we don't track what branch a folder in the workspace was created from anywhere in the workspace---that information is only available in the repository. Before creating the new branch for the user, we could also checkout a new osbv2-orig branch that we can then use in the future---it will indicate what branch the folder was created from?
The remote is available now as origin, and we could also tweak our github-copy to rename the remote to osbv2-original or something like that just to make sure things don't fall over if the user decided to change the URL for origin to their private fork or whatever.
Now that we're using Git for the GitHub repositories, it's quite simple to update the files in the workspace. From the UI, of a user selects the same files/folders again, this is already done for them. But it could be also done from the workspace side of things with something like this:
.git
folder ---these are GitHub repositoriesgit commit -a ..
to save the current stategit checkout <branch> *
(this may fail if the user has created new files that are not tracked by the repo, though, not sure if there's a way around this---we could just show a message with "failed, you probably have modified files in there" or something like that)git commit -a
The only issue I see here is that we don't track what branch a folder in the workspace was created from anywhere in the workspace---that information is only available in the repository. Before creating the new branch for the user, we could also checkout a new
osbv2-orig
branch that we can then use in the future---it will indicate what branch the folder was created from?The remote is available now as
origin
, and we could also tweak ourgithub-copy
to rename the remote toosbv2-original
or something like that just to make sure things don't fall over if the user decided to change the URL fororigin
to their private fork or whatever.