-
Notifications
You must be signed in to change notification settings - Fork 105
Home
Welcome to the ev-dashboard wiki!
- Do a copy of your local repositories
- Open a terminal or a PowerShell windows and go in the repository directory. Visual Code can do this for you automatically: Terminal -> New Terminal and choose the targeted local repository directory if needed
- Checkout master-qa branch: type
git checkout master-qa
(Visual Studio can probably also do it via a GUI) - Type
git reset --hard origin/master-qa
to reset your local history index and tree in master-qa with the GitHub remote master-qa branch ones
In the local repositories, you will find all the local changes you've made in each of your branches. Now you want to report the changes made in your <topic-branch> on the history rewritten master-qa.
In the previously opened terminal in the targeted local repository:
-
git checkout master-qa
-
git branch -b <topic-branch-new-name>
-
git checkout <topic-branch>
-
git pull origin master-qa-old
and fix eventual conflicts -
git diff -M origin/master-qa
to visualise your changes -
If you're ok with the changes:
git diff -M origin/master-qa > <topic-branch>.patch
or continue editing until you're ok -
git checkout <topic-branch-new-name>
-
git apply --ignore-space-change --ignore-whitespace <topic-branch>.patch
If the patch doesn't apply, try:- on Windows:
Get-Content .\<topic-branch>.patch | Set-Content -Encoding utf8 <topic-branch>-fixed.patch
- on *nix:
iconv -f ascii -t utf-8 <topic-branch>.patch -o <topic-branch>-fixed.patch
git apply --ignore-space-change --ignore-whitespace <topic-branch>-fixed.patch
If it still doesn't apply, try:
git apply --reject --whitespace=fix <topic-branch>.patch
Then manually merge the rejection in *.rej files and delete them - on Windows:
-
rm <topic-branch>.patch
Then you can work as usual on <topic-branch-new-name> and delete your old <topic-branch>.
Repeat for each of your branches.
git clone --recurse-submodules <repo-uri>
git submodule --init --recursive
Must be executed after submodule repository URI changes in .gitmodules
git submodule sync
npm run git:supdate
npm run git:spush
npm run git:sdiff
Git submodules used in a repository are shown just as a first class repository in Visual Code. You can just treat them like any other repository
You'll have to keep in mind if you make changes to one submodule repository, you'll have to:
- use a consistent naming for the branches in the main and the submodule repository
- commit first yours changes in the submodule repository
- ensure the main repository reference the commit id pointing to your latest changes in the submodule repository with
git diff
ounpm run git:sdiff
- do two PRs: one on the main repository and one on the submodule repository
Git submodules paths in ev-server:
src/assets/configs-aws
src/integration/pricing/convergent-charging
src/integration/refund/concur
src/integration/smart-charging/sap-smart-charging
src/assets/charging-station-templates
So, carefully handled the changes you might do in that paths
Example: You have to make change on the SAP Smart Charging git submodule in ev-server:
- create a branch from the up to date master-qa branch in the ev-server main repository: <feature-name>
- create a branch from the up to date master-qa branch in the SAP Smart Charging git submodule repository with the same name: <feature-name>
- do your changes that impact the both repositories and test them
- commit your changes in the SAP Smart Charging git submodule repository and push them in the branch
- commit your changes in the ev-server main repository and push them in the branch
- do a PR from the branch on the SAP Smart Charging git submodule repository
- do a PR from the branch on the ev-server main repository
The same goes on each submodules in ev-server impacted by your changes.
Most of the time, you'll just have to pull the submodules latest changes after a git pull
on the main repository. You can do it one by one in Visual Code or run npm run git:supdate
git submodule foreach 'git reset --hard'
The targeted branch must exist.
git submodule foreach 'git checkout <branch-name>'