Skip to content

Instantly share code, notes, and snippets.

@seeliang
seeliang / lint-only-changed-files.MD
Last active June 10, 2024 05:37
How to lint only changed files?

find out the differences

use git diff to generate file list

git diff --name-only master

limited to certain file types

add ext filter

@paulolorenzobasilio
paulolorenzobasilio / git-is-merged
Last active May 23, 2024 16:57
Check if source branch has been already merged into destination branch
#!/usr/bin/env bash
#
# Check if source branch has been already merged into destination branch
# https://stackoverflow.com/questions/226976/how-can-i-know-if-a-branch-has-been-already-merged-into-master
#
git_is_merged () {
merge_destination_branch=$1
merge_source_branch=$2
@rvl
rvl / git-pushing-multiple.rst
Created February 9, 2016 11:41
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just