git-gc
NAME
git-gc - Cleanup unnecessary files and optimize the local repository
SYNOPSIS
git gc [—aggressive] [—auto] [—quiet] [—prune=<date> | —no-prune]
DESCRIPTION
Runs a number of housekeeping tasks within the current repository, such
as compressing file revisions (to reduce disk space and increase
performance) and removing unreachable objects which may have been
created from prior invocations of git add.
How I learned to use: git add . -A
I asked myself: there is a better way to do that?
git rm `git status | grep deleted | awk ‘{print $3}’`
Yes, there is.
shared repository between svn and git without git-svn
In mashape, internally, we are using subversion. But we wanted to open some code (the server and client libraries) on github (here our profile: github.com/Mashaper).
When you have to create a brand new github repository the process is pretty straightforward
- create a new repository on github
- enter your working copy
- git init
- create a new .gitignore with “.svn” as content
- git remote add origin $github-repo-url
- git add/commit and push
When the repository is already on github (maybe you are working from another pc) the process is a little bit tricky
- checkout from svn
- enter the working copy
- git clone —no-checkout $github-repo-url
- create a new .gitignore with “.svn” as content
- git reset and, if needed, checkout/add
in this way I can commit on both version control systems, to have the same location shared on subversion (needed for some internal scripts) and the open source version.
And, obviously, I can send and receive updates in each direction