Skip to content

Latest commit

 

History

History
53 lines (34 loc) · 1 KB

File metadata and controls

53 lines (34 loc) · 1 KB

Commands

Contents

Clonable bundle

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 --all

Then, we can use the repository by cloning it:

git clone <path_to_bundle_file>

Push force with lease

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-lease

We can also add a .gitconfig alias to make it shorter

[alias]
    fpush = push --force-with-lease

Go to root

Using git rev-parse

cd $(git rev-parse --show-toplevel)

Add an alias

alias gr='cd $(git rev-parse --show-toplevel)'