Using git bundle, we can create a clonable git bundle that we can send by mail.
The syntax is:
git bundle create your_name.bundle --allThen, we can use the repository by cloning it:
git clone <path_to_bundle_file>To avoid some commits to be ereased, we can use --force-with-lease instead of just --force.
It will ensure the remote version index is up to date in local so our collegue most recent commit will not be removed.
git push --force-with-leaseWe can also add a .gitconfig alias to make it shorter
[alias]
fpush = push --force-with-lease
Using git rev-parse
cd $(git rev-parse --show-toplevel)Add an alias
alias gr='cd $(git rev-parse --show-toplevel)'