Skip to content

Instantly share code, notes, and snippets.

Nataliya Karatkova meuwka

View GitHub Profile
View git
Local git clear:
git branch --merged | grep -v '\*\|master\|develop' | xargs -n 1 git branch -d
Remote git clear:
git branch -r --merged | grep -v '\*\|master\|develop' | sed 's/origin\///' | xargs -n 1 git push --delete origin
meuwka / git-stop-tracking-file
Created Nov 5, 2015
If you want to temporarily stop tracking a file, you can still use
View git-stop-tracking-file
git update-index --assume-unchanged <file>
// track changes again :
git update-index --no-assume-unchanged <file>

To limit pushes to your current branch:

$ git config --global push.default simple

To default all new branches to fetch and rebase - not merge:

$ git config --global branch.autosetuprebase always
View images-on.js
Will add the class `images-on` to <body>
Check if images are disabled:
(function() {
var image = new Image();
image.onload = function() {
if (image.width > 0) {
meuwka / git-restore-master
Created Oct 24, 2014
restore the original master
View git-restore-master
git checkout develop
git branch -D master
git fetch
git checkout -t origin/master
View git-hotfix
git checkout develop
git pull --rebase origin develop
git checkout master
git pull --rebase origin master
git fetch --tags
git tag -l
git flow hotfix start 3.6.12
git flow hotfix finish -m 'description' 3.6.12
git push && git push --tags

git stash

добавить текущие незакоммиченные изменения в стек изменений и сбросить текущую рабочую копию до HEAD’а репозитория;

git stash list

показать все изменения в стеке;

git stash show

meuwka / GIt-flow & Start working of existing feature branch
Created Dec 7, 2013
This command create a new branch in your local repository named feature/name and that branch is going to be connected with your remote branch origin/feature/name that you published before.
View GIt-flow & Start working of existing feature branch
git checkout -t origin/feature/name
git flow feature track name
View Git-flow reinitialize workspace
git config --unset gitflow.branch.master
git config --unset gitflow.branch.develop
git config --unset gitflow.prefix.feature
git config --unset gitflow.prefix.release
git config --unset gitflow.prefix.hotfix
git config --unset
git config --unset gitflow.prefix.versiontag
git flow init
You can’t perform that action at this time.