I have changed content of hello.js in previous lab and when I refreshed the content of directory using update.sh, hello.js reloaded with original file and I have lost my changes. So it refresh all the content from directory, though it refresh only missing directories or files ?
You’re right, but fortunately, there is a solution.
Git has a feature called stashing. Basically, you can make changes to your files. Before you download a copy of the new contents of the repository, git can stash these changes you’ve made, to bring them back after the download.
update.sh script, he brilliantly added in this functionality, and git will stash any changes before downloading the full copy. To retrieve them, go to the
gcp-cloud-engineer directory, and run the command
git stash apply. This should bring back everything from the stash.
It might be better to fork the Github project. Then you can:
1. Clone the project from your fork.
2. Push changes to your fork.
You can read about forking here: https://help.github.com/en/github/getting-started-with-github/fork-a-repo