git push a new version without history

C++
git clone --depth <depth> -b <branch> <repo_url>

Source

Also in C++: