Git

Git Clients

Delete File from Git Repo

Accidentally pushed big binary blobs, passwords or other sensitive data into a git repo?

This can be solved the hard way by using filter-branch1 or by using the tool BFG Repo-Cleaner.

$ java -jar /e/xampp/tools/bfg.jar --delete-folders @docs
$ bfg --delete-files data.md

Remote Repo

Clone repo to remote

$ cd /f/REPOSITORY
$ git clone --bare /e/WEB/my-project.com

https://stackoverflow.com/a/30047571/814031

Push everything into remote

$ cd  /e/WEB/my-project.com/
$ git push origin --all
$ git push origin --tags

https://stackoverflow.com/a/6865367/814031

Pull shallow copy to empty folder

$ cd  /e/WEB/my-project.com/
$ git log --format=oneline --since="2014-02-12T16:36:00-07:00" | wc -l
$ git log --format=oneline --since="3 years ago" | wc -l
$ git clone --depth 10 /f/REPOSITORY/my-project.com.git

Find --depth by time https://stackoverflow.com/a/21743961/814031

Reduce Repo Size

Move .git folder to existant folder

$ git clone /f/REPOSITORY/my-project.com.git temp
$ mv temp/.git code/.git
$ rm -rf temp

https://stackoverflow.com/a/13852329/814031