npp-usermanual

These will help me with npp-usermanual and team:npp-user-manual-admin

misc

git vs svn

Derived from Git for SVN users and other similar resources in the references section. Collating here (mainly because the original doc is now only available through the wayback machine).

; the branch -D may be needed to actually delete after being pruned
svngitnotes
main
svn checkout URLgit clone URL [DIR]checkout to specified directory (defaults to same as repo name)
svn checkout URL/subfolder git clone -n --depth=1 --filter=tree:0 URL cd newDirectory git sparse-checkout set --no-cone subfolder git checkout partial checkout => sparse checkout ...
SO Answer => keeps the full hierarchy even with subfolder/deepfolder
svn updategit pull...
svn infogit remote -v
or
git remote show origin
info about the repo/checkout
svn log | lessgit log...
svn blame FILEgit blame FILE...
svn diff | less
svn diff -rREV PATH
git diff
git diff REV PATH
...
svn statusgit status...
svn revert PATHgit checkout PATH...
svn add PATHgit add PATH...
svn rm PATHgit rm PATH...
svn mv PATHgit mv PATH...
svn commit -m MMMgit commit -a -m MMM
git push origin [BRANCHNAME]
commit recursively to local repository, then push to remote (origin);
BRANCHNAME is optional if things are mapped correctly
svn commit FILESPEC -m MMMgit add [FILESPEC]
git commit -m MMM
git push origin [BRANCHNAME]
same, but only a single file (need to add it if there isn't commit -a)
branches
svn copy URL/trunk URL/branch/BRANCHNAMEgit branch BRANCHNAMEcreate a new branch
git push origin localbranch:remotebranchworking on localbranch on my machine, but want to push to a new branch at github (seen on CodingTrain)
svn switch ^/branches/BRANCHNAMEgit checkout BRANCHNAME
or
git checkout -b BRANCHNAME origin/BRANCHNAME
switch working copy to the branch

(the second keeps it in sync with the remote BRANCHNAME)
svn merge ^/branches/BRANCHNAMEgit merge BRANCHNAMEmerge changes from BRANCHNAME into local
svn list ./branches/git branchlist only local branches
svn list ^/branches/git branch -rlist only remote branches
svn list ./branches ^/branches/git branch -alist local and remote branches
git branch -vvlist branches with extra details;
ones with "gone" should be pruned
git fetch -p
git remote prune [-n] <name>
git branch -D <branchname>
prune deleted remote branches from branch -r/-a list, where name is normally origin; -n is same as --dry-run
git configuration
git config --global user.name VALUE
git config --global user.email VALUE
configure username/email for all repos (omit VALUE to read)
git config user.name VALUE
git config user.email VALUE
configure username/email for current repo to be different than the global setting (omit VALUE to read)
git config --global init.defaultBranch mainuse 'main' instead of 'master'
SVN_EDITOR=c:/usr/local/scripts/block++.batgit config --global git config --global core.editor "c:/usr/local/scripts/block++.bat"set editor for commit messages
git config remote.origin.prune trueautomatically prune deleted remote branches
git config --list
git config --list --global
list all configured options
misc
svn:externalsgit subtree mergesembed external repo links *

references

page look-and-feel inspired by lifehacker.me