git checkout FEATUREBRANCH
git pull upstream master --rebase
How many commits you want to reduce?
git log --oneline
Assuming 2
git rebase -i HEAD~2
In this editor, replace the topmost pick
with r (reword) and all pick
's below with f (fixup).
In the topmost line, only r (reword) is parsed, the (reworded) message in the line is ignored and after quiting the first editor a second editor opens to enter the reworded commit message.
git rebase master YOUR_BRANCH
# DO NOT git pull BECAUSE IT SOMEHOW REVERTS THE REBASE
git push --force origin
git remote add cmcmarrow https://github.com/cmcmarrow/salt.git
git fetch cmcmarrow
git remote -vv
git checkout --track cmcmarrow/code_Page_for_shell ???
git checkout --track origin/code_Page_for_shell ???
git checkout master
git fetch upstream
git reset --hard upstream/master
git push --force
Repeat:
git merge --abort
git checkout filename
git rm --cached FILE
and add file to .gitignore
git diff origin FILE
Overview
git diff --stat --cached origin/master
Show diff lines
git diff --cached origin/master
git branch -avv
git branch -d FOO
git push origin -d FOO
Other commands
git cherry -v
git diff 4ad879ee548630b6a9dd076d308acf2e667564ee^!
git log --branches --not --remotes
git reset HEAD PATH_TO/FILE
git reset HEAD~1
git status
https://git-scm.com/docs/git-reset
git reset FILE
git log HEAD..origin/master
git rebase origin/master
git pull --rebase
git checkout -b NEW_THINGS
DO NOT ADD origin/master!!!!!!!!!!!!!!!!!!
git checkout -b NEW_THINGS origin/master
Problem 1: git clone
does not clone branches, but git fetch origin
does.
Problem 2: git fetch origin
does not clone branches if you did git clone --depth=1
git fetch origin
git brach -r // show remote branches
FIND! origin/B1
git checkout B1
VERIFY! Branch 'B1' set up to track remote branch 'B1' from 'origin'.
VERIFY! Switched to a new branch 'B1'
THIS WORKS
git fetch --tags --all
git pull upstream master
THIS DOES NOT WORK
git pull --all
Rebase should not be needed because you should not work on master
git checkout master
git fetch upstream
git merge --ff-only upstream/master || git pull --rebase origin master
git push origin master
YOUR MASTER BRANCH MUST NOT CONTAIN WORK
MAYBE THIS WORKS
git pull --rebase
git checkout . | revert changes on your working copy
git clean -n | show delete
git clean -f | delete files
git clean -fd | delete file and folders
git reset --hard upstream/master
git push --force
Don't pull in between
git clone git@github.com:marbx/salt.git && cd salt
git remote add upstream git@github.com:saltstack/salt.git
git remote -vv
git fetch --all
git fetch --tags upstream
git tag
git clone https://github.com/marbx/community.git && cd community
git remote add upstream https://github.com/saltstack/community.git
git remote -vv
cd ..
mv community salt_community
git clone git@github.com:marbx/salt-windows-msi.git && cd salt-windows-msi
git remote add upstream git@github.com:saltstack/salt-windows-msi.git
git clone https://github.com/marbx/libtorrent.git && cd libtorrent
git remote add upstream https://github.com/arvidn/libtorrent.git
git fetch --all
git pull upstream master
git push
git clone https://github.com/marbx/pywin32.git && cd pywin32
git remote add upstream https://github.com/mhammond/pywin32.git
git remote -vv
- - - - -
pip install wheel
python setup.py bdist_wheel
git clone https://github.com/marbx/deluge.git && cd deluge
git remote add upstream https://github.com/deluge-torrent/deluge.git
git remote -vv
git fetch --all
git pull upstream master
git push
git -Sfindme -p | show findme in all version