Line endings messed up in Git – how to track changes from another branch after a huge line ending fix?

I finally managed to solve it. The answer is: git filter-branch –tree-filter ‘~/Scripts/fix-line-endings.sh’ — –all fix-line-endings.sh contains: #!/bin/sh find . -type f -a \( -name ‘*.tpl’ -o -name ‘*.php’ -o -name ‘*.js’ -o -name ‘*.css’ -o -name ‘*.sh’ -o -name ‘*.txt’ -iname ‘*.html’ \) | xargs fromdos After all line endings were fixed in all … Read more

git branch permissions

Git does not have branch specific permissions. You can either make the whole repository read only to the people or create one private and one public repository and only push the development branch to the public on while keeping the master only in your private repository. Edit: For branch specific permissions, you need a server-side … Read more

Can git permanently ignore a remote branch?

Since git 2.29, released in october 2020, you can leverage negative refspec to exclude a specific branch to be fetched. For GitHub Pages, you can do it like so: git config –add remote.origin.fetch ‘^refs/heads/gh-pages’ And Dependabot: git config –add remote.origin.fetch ‘^refs/heads/dependabot/*’ You can read more about it on https://github.blog/2020-10-19-git-2-29-released/#user-content-negative-refspecs

Git and working on multiple branches

There are two solutions not mentioned already that you can use: use a topic branch or use cherry-picking. Topic branch solution In the topic branch solution, you switch to branch ‘something’, create a branch to fix a bug e.g. ‘something-bugfix’, merge this branch into ‘something’ (fixing the bug), then merge this branch into ‘experimental’. $ … Read more

SVN Mergeinfo properties on paths other than the working copy root

Subversion 1.5.x adds a lot of svn:mergeinfo properties, even on files/folders which you think have nothing to do with the merge. But Subversion still uses those to reduce the merge time for subsequent merges. If you don’t like those, you can safely remove those modified/added svn:mergeinfo properties from all files/folders which were not part of … Read more

Install Gem from Github Branch?

You don’t need to build the gem locally. In your gemfile you can specify a github source with a ref, branch or tag. gem ‘rails’, git: ‘git://github.com/rails/rails.git’, ref: ‘4aded’ gem ‘rails’, git: ‘git://github.com/rails/rails.git’, branch: ‘2-3-stable’ gem ‘rails’, git: ‘git://github.com/rails/rails.git’, tag: ‘v2.3.5’ Then you run bundle install or the short form is just bundle. Read more … Read more