Skip to content

m-dimmitt-forks/Github_Map_Closing_Notes

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 

Repository files navigation

Github_Map_Closing_Notes

#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;

Of these I am a fan, listed with favorite first!

  1. git log --name-status
  2. git log --pretty=oneline
  3. git log --graph --oneline --decorate --all

Remove a file from git history: source1 source2

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
}

Cleanup specific branches: UNTESTED function.

function cleanupSafeBranches(){
  branches=$($1 develop)
  git branch | grep -v $branches | xargs git branch -D
}

My development environment remote information for a project

remote origin commit information can be found in the linked issue:
Swuber/unf-swuber_web_app_phoenix#4

Check out the first time I needed to use SVN instead of git.

neat way I get a part of a repository without the whole enchillada:
https://github.com/MichaelDimmitt/sc/blob/master/install.sh

Update a Branch

git remote add upstream https://github.com/whoever/whatever.git;
git rebase upstream/master;
git push -f origin master;

Updating Forked Repository

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;

Git LFS (large files)

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

Cherrypicking

http://stackoverflow.com/questions/9339429/what-does-cherry-picking-a-commit-with-git-mean

  1. Make sure you are on the branch you want apply the commit to. git checkout master
  2. 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

how github handles repo names

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.

when rebasing a large number of commits (implemented in next header)

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)

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

warning regarding github map, in view mode.

submodules are only for viewing.
edits should be performed by cloning
and pushing particular repositories.

updating a map

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;

Additional Information coming soon.

secrets ... people may be warned

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!

About

A lot of good git command information here.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published