filter-branch. This is how I removed that big file from history:
Both commands took a while to complete, but after that I had a light repo again. If you need to do this, be sure to keep a copy of your repo around in case something goes wrong. Here's an old, but still seemingly still correct blogpost by Dalibor Nasevic with some more info on the subject.
git filter-branch --tree-filter 'rm path/to/your/bigfile' HEAD git push origin master --force
Few weeks ago I froze gems on my blog and ended up with a very big repository. So, I wanted to clean up the mess and remove permanently gems folder from the repository. git rm wasn't doing the job well, it only removes the folder from the working tree and the repository still contains the objects of this folder. After a quick search, I found that git-filter-branch was the command I was looking for.https://dalibornasevic.com/posts/2-permanently-remove-files-and-folders-from-a-git-repository
gitcommand. Once it's installed you can do stuff like this (take from the manual page)
# clone your own project $ git clone dotfiles → git clone git://github.com/YOUR_USER/dotfiles.git # clone another project $ git clone github/hub → git clone git://github.com/github/hub.git # open the current project's issues page $ git browse -- issues → open https://github.com/github/hub/issues
Want to use all this cool stuff too? Head over to the installation instructions on GitHub.
# Example workflow for contributing to a project: $ git clone github/hub $ cd hub # create a topic branch $ git checkout -b feature ( making changes ... ) $ git commit -m "done with feature" # It's time to fork the repo! $ git fork → (forking repo on GitHub...) → git remote add YOUR_USER git://github.com/YOUR_USER/hub.git # push the changes to your new remote $ git push YOUR_USER feature # open a pull request for the topic branch you've just pushed $ git pull-request
I just recently joined a new open source project, and there were a few folks on the team who weren't familiar with how to contribute to an open source project by forking your own copy, so I wrote this up for the docs of that project. I figured I'd also share it here. If you join a new open source project, it's very likely that you won't get direct access to push commits or branches up to the repository itself. So, instead, you'll fork the repo, make the changes on your version of the repo, and then "pull request" your changes back to the original. Here are the steps to take.https://mattstauffer.co/blog/how-to-contribute-to-an-open-source-github-project-using-your-own-fork
Git has a strong commitment to backwards compatibility: many powerful features are hidden behind options rather than exposed as default behaviour. Fortunately Git also supports aliases, so you can create your own commands that do all manner of Git magic. Here’s a selection of the more useful (or at least entertaining) aliases defined in my .gitconfighttps://hackernoon.com/lesser-known-git-commands-151a1918a60
This essay explains how Git works. It assumes you understand Git well enough to use it to version control your projects.
The essay focuses on the graph structure that underpins Git and the way the properties of this graph dictate Git’s behavior. Looking at fundamentals, you build your mental model on the truth rather than on hypotheses constructed from evidence gathered while experimenting with the API. This truer model gives you a better understanding of what Git has done, what it is doing, and what it will do.
So I'd like to stress that while it really came together in just about ten days or so, it wasn't like it was some kind of mad dash of coding. The actual amount of that early code is actually fairly small, it all depended on getting the basic ideas right. And that I had been mulling over for a while before the whole project started. I'd seen the problems others had. I'd seen what I wanted to avoid doing.http://www.linux.com/news/featured-blogs/185-jennifer-cloer/821541-10-years-of-git-an-interview-with-git-creator-linus-torvalds The source code manager to build git was... git.
If you have write access to a composer package repository, you have the possibility to continue its development while it is installed as requirement in another project. Let's see how we can accomplish this.http://dimsav.com/blog/9/git-repository-inside-composer-vendors If you have another, possibly better, way to go about this, let me know in the comments.
As someone who’s always felt fairly comfortable in Git, I thought sharing some of the nuggets I learnt with the community might help someone to find an answer without needing to do lots of research.
git config --global core.excludesfile '~/.gitignore'If you're on osx you can add files such as
Thumbs.db, ... PhpStorm-users could add
.idea. My global .gitignore file can be viewed on github.