#the below command is good for beginners. git revert HEAD #undo your commit with a new commit #git revert can be reverted with another git revert.
do not default to this: git add .; git commit --amend --no-edit; git push --force-with-lease;
- git log --name-status
- git log --pretty=oneline
- git log --graph --oneline --decorate --all
git filter-branch --prune-empty
--index-filter "git rm --cached -rf --ignore-unmatch oops.iso" \
--tag-name-filter cat -- --all
Cleanup last seven: UNTESTED function. source1
function cleanupLastSeven(){
git branch --sort=-committerdate | tail -n+7 | tr '\n' ' ' | xargs git branch -D
}
function cleanupSafeBranches(){
branches=$($1 develop)
git branch | grep -v $branches | xargs git branch -D
}
remote origin commit information can be found in the linked issue:
Swuber/unf-swuber_web_app_phoenix#4
neat way I get a part of a repository without the whole enchillada:
https://github.com/MichaelDimmitt/sc/blob/master/install.sh
git remote add upstream https://github.com/whoever/whatever.git; git rebase upstream/master; git push -f origin master;
git remote add upstream https://github.com/whoever/whatever.git; git pull upstream master; git rebase upstream/master; git push -f origin master;
In one command:
git remote add upstream https://github.com/whoever/whatever.git;git pull upstream master;git rebase upstream/master;git push -f origin master;
Alternate
https://stackoverflow.com/questions/7244321/how-do-i-update-a-github-forked-repository
git remote add upstream https://github.com/whoever/whatever.git; git fetch upstream master; git checkout master; git rebase upstream/master; git push -f origin master;
brew install git-lfs; git lfs install; git lfs track "*.iso"; git add .gitattributes; git lfs ls-files; https://github.com/git-lfs/git-lfs?utm_source=gitlfs_site&utm_medium=repo_link&utm_campaign=gitlfs
http://stackoverflow.com/questions/9339429/what-does-cherry-picking-a-commit-with-git-mean
- Make sure you are on the branch you want apply the commit to.
git checkout master
- Execute the following:
git cherry-pick <commit-hash>
git notes copy <fromcommithash> <tocommithash>
simplify into single command: git checkout branch; git cherry-pick git notes copy
github allows [A-Za-z0-9_.-], and transforms all other characters to "-"
when we were getting each file name
we needed to check immediately if it passed and ignore/not create repo if it failed.
if squashing make changes on a seperate branch
then, do not merge;
instead preserve the old copy of master renaming
and then change the rebased branch to master
(implemented in next header: how to change master branch)
git branch -m master old-master
git branch -m seotweaks master
git push -f origin master
git push origin master:master --force
If you want to rename the current branch, you can do:
git branch -m newname
submodules are only for viewing.
edits should be performed by cloning
and pushing particular repositories.
git clone --recursive https://github.com/MichaelDimmitt/Research.git
cd Research/;git submodule update --remote --merge;
git add .;git commit -m "applied updat operation git submodule update --remote --merge”;git push;
git clone --recursive https://github.com/MichaelDimmitt/Research.git;
git rebase -i 504faf7d0b72c6d8e6fc0279a40fb39143d6d0ad
vi README.md
git add .
git commit --amend --author="MichaelDimmitt <[email protected]>" --no-edit
git rebase --continue
git push --force-with-lease
git revert #moves commit backwords witha new commit. So you could revert a revert.
git merge --squash <branch_name> #I do not recommend. rebase -i to squash your commits.
git braanch -vv #this is a nice goodie!