Git: Few Good Commands

By polfilm,

  Filed under: GIT
  Comments: None

To move repo with history

git clone --bare <old_repo>
cd into bare old_repo and: git push --mirror <new_repo>

To clone from HTTPS with self-generated cert

git -c http.sslVerify=false clone https://<repo>

Restore all deleted files in folder

git ls-files -d | xargs git checkout --

Automatic Versioning
Begin Versioning:

git tags -a 2.1

Retrieve:

git describe --tags

Result similar to this where 411 is number of commit for above given tag.

2.1-441-gff635ba

Be the first to write a comment.

Your feedback

You must be logged in to post a comment.