Monday, October 29, 2018

Basic git commands

So you are starting to research about code versioning and heard about git and github?

Below are some very few basic commands that I use to clone a github repository, create a new branch to develop a new feature or fix a bug, add and commit modifications to the branch and push it to github's repository.


# To clone a repository is the same as to download the files from a github repository to your local machine:
git clone <github-repository-address>


# Then you will create a new branch
git checkout -b <new-branch>


# after your development is ready, you add it to git and commit
git add .
git commit -m "<commit message>"


# after the commit is done, change to master and merge it
git checkout master
git merge <new-branch>


# after the merge is done, push it to the remote repository
git push origin master

WARNING: lib not found when converting python script using pyInstaller

When trying to convert a Python script to .exe using pyInstaller, warning message is shown:
WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of C:\Program Files (x86)\Python\python.exe


The command line used is:
pyinstaller --onefile --noconsole main.py


Looking for the file, I could find it in the following path:
C:\Program Files (x86)\Java\jre1.8.0_181\bin


pyinstaller version in use is 3.3.1 and the latest one available at the moment is 3.4, so I proceeded on upgrading it.


Firstly uninstalling the current pyinstaller version:
pip uninstall pyinstaller


Then installing the newest and desired version:
pip install pyinstaller


After updating pyInstaller version, build was successfull:
set JAVA_HOME=C:\Program Files (x86)\Java\jre1.8.0_181
set PATH=%JAVA_HOME%\bin:%PATH%
pyinstaller --onefile --noconsole main.py