...stale branches pile up over time. It's best to remove them right after merge, locally and on the remote, but it is a little tedious: you need to remember...

Enter Git hooks. The folks at Liquid Light have built a little post-merge hook that will delete a feature branch on confirmation. Quick aside: Git hooks location

Merge requests are often rejected for similar reasons. To avoid this, before you send a merge request, please confirm that your code ... has been reviewed by yourself beforehand fulfills every...

...new features but the latest commits are not ready for production? Then use git merge master~n to skip the n-last commits. Tip A big advantage of merging vs...

...that cherry-picking will create copies of all picked commits. When you eventually do merge the branch after cherry-picking, you will have duplicate commit messages in your history.

In Ruby on Rails ActiveRecord::Relation#merge overwrites existing conditions on the same column. This may cause the relation to select more records than expected: authorized_users = User.where(id...

...authorized_users.merge(filtered_users).to_sql # => SELECT * FROM users WHERE id IN (2, 3) The merged relation select the users (2, 3), although we are only allowed to see...

...a complete restore, first create a dump with only the tables you want to merge: pg_dump -Fc -t barfoo -f dump_b-barfoo.pgdump database pg_dump will also dump all depended...

...database objects. Now you can create merge the two dumps with: pg_restore --clean --if-exists --no-owner --no-privileges -d restore dump_a.pgdump pg_restore --clean --if-exists --no-owner...

...use this to build an alias that automatically pushes a branch and creates a merge request for it. Put this in your ~/.gitconfig in the [alias] section: mr = push origin...

...HEAD -o merge_request.create -o merge_request.draft Now you can do git mr and a draft merge request will be created. Target branch is your project's default branch, i.e. main or...

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.\

Projects with more than one developer should always consider to enforce code review even for small changes to improves the...

...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...

makandracards.com

Resolve @{-1} to actual branch name. (Happens when merging...

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...

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...

beust.com

...have cloned your project, made a modification to it and then asking you to merge their changes back into the main project. There are a lot of ways you can...

jetbrains.com

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...

kernel.org

The ‘merge.*.driver` variable’s value is used to construct a command to run to merge ancestor’s version, current version and the other branches’ version. The merge driver is...

...expected to leave the result of the merge in the file named with %A by overwriting it, and exit with zero status if it managed to merge them cleanly, or...

...re done with your feature and tests are green, and your changes pass our merge request checklist: Within your feature branch, merge the current main and push using:

...encouraged to use git pull --rebase if you know how it works. Open a merge request by clicking the link Gitlab prints on push. To open a merge request manually...

makandra dev

... 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.

...Rails has a method ActiveRecord::Relation#merge that can merge ActiveRecord scopes. However, its behavior has never been clear, and in Rails 7 it still discards conditions on the same...

...column by the last condition. We discourage using #merge!) The best way to merge ActiveRecord scopes is using a subquery: scope_a.where(id: scope_b) It is a little less concise...

...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...

...for grouping', 'more data used for grouping']) All issues with this fingerprint will be merged, regardless of their backtraces. For example, to always group all exceptions of a specific type...

...error, fingerprint: [error.class.name]) raise(error) See the SDK Fingerprinting docs for more generic approaches. Merging errors manually Another approach is to tell Sentry to merge events with different fingerprints into...

makandra dev

...Possibly a second list of things I want myself to remember ... 3.2 Create the merge request Within your feature branch, merge the current master and push using: git pull origin...

...encouraged to use git pull --rebase if you know how it works. Open a merge request by clicking the link Gitlab prints on push. To open a merge request manually...

...person working on this branch. We also assume the branch has never been "partially" merged into master. You want to start a feature branch git checkout master git checkout -b...

...them and continue using git rebase --continue. Note that conflicts are "reversed" compared to merging, i.e. master is the base, and your commits are the changes. Never use merge.

...finishes an issue, they will set it to "Review" on Linear and open a merge request on GitLab. You will receive an e-mail. Now review the code, either directly...

...do if the code is okay If the code is okay, you may either merge it into main yourself: Squash and merge into main Push Delete the branch with

...Another is that now they will always be included in your git diff for merge requests. There are two options how you can address this: Option 1: exclude from diff...

...and run git diff afterwards to check if everything worked You will have to merge them into you main branch at least one time to make it work on merge...