1) Make sure you have a private key to access the repository (this only need to happen once). If you don’t have a private key, then:
– Start -> All Programs -> TortoiseGit -> PuttyGen
– Click on “Generate” to generate a new random key.
– You will then see your Public key. This key needs to be inserted in your Git profile. Go to your Git account (GitHub, Bitbuket, or the one you use) . Go to your Profile Settings and locate “SSH Keys”. Paste your public key here.
– Go back to Putty and Save your private key to any local directory (Ex: C:\MyKey). Make sure you don’t move or delete this folder.
2) Now with private key ready, right click in folder you want the repository to be in and click on “Git Create repository here…”.
Now you have a local folder for your repository. This repository needs to contain the -prj folder and .qvw file. You can even create your repository in your development folders.
Committing your changes
There are 3 stages when committing changes.
a) Committing to a local branch. This is stored locally and if something happens to your computer, changes will be lost.
b) Push to a remote branch. All changes will be committed to a branch in the server.
c) Push to Master branch. The Master branch is that with the working copies. You can commit several changes to your remote branch before you commit to the master (and final version) repository.
To commit a file, right click, “Git Commit”. There you’ll have a the option to create your local branch.
At this point everything is committed to your local branch. We can now click on “Push” to commit it to our remote branch. (We are still not changing the master repository, but putting everything in the server in case anything happens with our computer).
We choose the local branch previously created and enter a name for the new branch in our server. Click ok.
No everything is in our remote branch. Before committing everything to our Master repository we can keep committing things to our remote branch. Once we are ready, we right click on our Repository folder, go to “Git Branch” and change it to “master”. That means that we will now be committing things directly to our master branch in the server. We can follow the same steps as before.
Now that our changes are in the master repository, the rest of the team can Pull everything to make sure they are working with the last version.
Recreating the .qvw application from .xml files
Let’s suppose we lose our local qvw application and xml files. We have everything in our remote repository. We first Pull everything from our repo. We will have our MyApplication-prj folder. We then:
1) Open Qlikview Desktop. Create a blank document and save it under the same path of MyApplication-prj (not inside this folder!). Do NOT name it the same as the report. Put any other name.
At this stage you should see 1 folder and 1 file:
2) Open Windows Explorer and press F2 on the .qvw to manually change the name to match the application name. (MyApplication.qvw). You should now have:
3) FROM WITHIN QLIKVIEW (do not double click on the file), go to File -> Open, and open the application. Qlikview will recreate the application based on your xml files.
Version control is very useful when working in big projects or when different people are working on the same file. Implement it only if it’s worth the trouble.
I hope you enjoy my post!