How to remove/delete a large file from commit history in the Git repository?

Use the BFG Repo-Cleaner, a simpler, faster alternative to git-filter-branch specifically designed for removing unwanted files from Git history. Carefully follow the usage instructions, the core part is just this: $ java -jar bfg.jar –strip-blobs-bigger-than 100M my-repo.git Any files over 100MB in size (that aren’t in your latest commit) will be removed from your Git … Read more

How can I specify a branch/tag when adding a Git submodule?

I’d like to add an answer here that is really just a conglomerate of other answers, but I think it may be more complete. You know you have a Git submodule when you have these two things. Your .gitmodules has an entry like so: [submodule “SubmoduleTestRepo”] path = SubmoduleTestRepo url = https://github.com/jzaccone/SubmoduleTestRepo.git You have a … Read more

What are the differences between “git commit” and “git push”?

Basically, git commit “records changes to the repository” while git push “updates remote refs along with associated objects“. So the first one is used in connection with your local repository, while the latter one is used to interact with a remote repository. Here is a nice picture from Oliver Steele, that explains the Git model … Read more

Can I specify multiple users for myself in .gitconfig?

You can configure an individual repo to use a specific user / email address which overrides the global configuration. From the root of the repo, run git config user.name “Your Name Here” git config user.email your@email.com whereas the default user / email is configured in your ~/.gitconfig git config –global user.name “Your Name Here” git … Read more

How can one change the timestamp of an old commit in Git?

You can do an interactive rebase and choose edit for the commit whose date you would like to alter. When the rebase process stops for amending the commit you type in for instance: git commit –amend –date=”Wed Feb 16 14:00 2011 +0100″ –no-edit P.S. –date=now will use the current time. Afterward, you continue your interactive … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)