tl;dr: Do not use merge! for session hashes. Use update instead. Outline Let's assume you're modifying the Rails session. For simplicity, let's also assume your session...
# ... def update(hash) load_for_write! super end As you can see: While merge! is the same as update on a regular Hash (they are not aliased), update has...
...can use them in your .gitlab-ci.yml in your project. To limit test runs to merge requests and the master branch, you can write this: tests: script: bundle exec rake tests...
- if: '$CI_COMMIT_BRANCH == "master"' - if: '$CI_PIPELINE_SOURCE == "merge_request_event...
...git pull origin other-branch If you keep rebasing by default, you can get "merge pulls" like this: git pull --no-rebase origin other-branch
Merging .po-files with Git is painful. There have been attempts of making Git more clever when trying to merge .po-files. I believe however that this is not enough...
...in different branches at the same time. In order to not accidentally produce invalid merges I additionally disable merging for po files altogether, by adding the following .gitattributes file to...
Resolve @{-1} to actual branch name. (Happens when merging...
Removing features and merging those changes back can be painful. Here is how it worked for me.\ tl;dr: Before merging back: reinstate reverted features in a temporary branch, then...
...merge that branch. Scenario Consider your team has been working on several features in a branch, made many changes over time and thus several commits for each feature.\
...push -o ci.skip This has a few cavates: Skips only branch pipelines and not merge request pipelines. This does not skip pipelines for CI/CD integrations, such as Jenkins...
When using _.extend/_.assign or _.merge, you will modify the destination object. object1 = { foo: 23, bar: 42 } object2 = { bar: 99 } _.extend(object1, object2) // => { foo: 23, bar: 99 } object1 // => { foo: 23, bar...
... restore deleted files - git restore ... restore historic versions - git restore --source ... recreate merge conflicts - git restore --merge ... specifiy how unmerged paths are treated by using --ours, --theirs or...
...it will check for applied change in the complete repository. Restore Changes affected by Merge Conflicts If you encounter merge conflicts, you have several options how to use restore.
Let's say you want to merge the properties of two JavaScript objects: let a = { foo: 1, bar: 2 } let b = { bar: 3, baz: 4 } let merged = merge(a, b...
...bar: 3, baz: 4 } Depending on your build, there are several ways to implement merge(). When you have ES6 When you have an ES6 transpiler or don't support IE11...
...just copy the folder into your working copy and try a commit without a merge because Subversion will die on you. Work on ./branches/$ticketnumber_shortdesc. If you work on...
...a long story it is useful to sometimes merge the trunk into your branch so there will be less pain later: svn merge https://dev.makandra.de/svn/filepanic/trunk ./branches/$ticketnumber_shortdesc.
RubyMine provides a visual tool for resolving merge conflicts locally. Follow Git > Resolve Conflicts in the context menu to open RubyMine's merge conflict tool. Left pane: local copy (read...
If you have the following deprecation warning after upgrading to rails >= 2.3.10 DEPRECATION WARNING: The :overwrite_params option is deprecated...
...in the background and reports test results. It is best to always make a merge request, and Github will automatically run test for that request. The advantage of Github Actions...
...and you're not allowed to push to master, you need to prepare a merge request (aka pull request). Push your branch, open the target repository on Github and press...
...it to production with this deploy. Ask if you want to proceed. If yes, merge the master into the production branch, push and deploy with bundle exec cap production deploy...
...hash.merge!(hash) do |key, old_value, new_value| # Return something end The block of merge! will be called whenever a key in the argument hash already exists in the base...
...you like (by returning old_value you'd get the behavior of Rails' reverse_merge!, by returning new_value you'd get the behavior of standard merge!). Note that there...
...reviewed your code. From now on you will also review code yourself: your colleagues' merge requests and — more and more — code that an agent wrote for you. Reviewing is a...
...and say what is good. You can explain our review process: feature branches, the merge request checklist, gatekeeping. You can explain what is different about reviewing agent-generated code, and...
...onto your HEAD. Most often you can achieve the same result with a rebase & merge. Example: master commit1 - commit3 feature-branch \ commit2 - commit4 git checkout feature-branch git reset --hard...
These might require extra configuration in Gitlab. [alias] # Push branch, create a merge request and set the branch to be removed on merge pmr = push -u origin HEAD...
...o merge_request.create -o merge_request.remove_source_branch # If you do not need a code review, but use the merge request to run a test pipeline: # Push branch, create a merge request...
...YAML-doc, e.g. when writing Rails locale files. Did you know that ... << is a merge key (similar to & in SASS) there are variables, called aliases. Definition: &alias Some content, usage...
Caveats Specifying a key twice does not merge the sub keys, but override the first definition, e.g. de: car: # overridden door: Tür wheel: Rad car: # only this is used...
...will make a copy of the picked commit, with its own hash. If you merge the branch later, the commit will appear in a history a second time (probably without...
...that importing a table overwrites an existing table. There won't be a magic merge...
You can tell git to ignore different kinds and amounts of whitespace when merging or cherry-picking. This often occurs when you changed indentation, or converted tabs to spaces.
git merge -Xignore-space-change or git cherry-pick -Xignore-space-change
Projects with more than one developer should always consider to enforce code review even for small changes to improves the...