Skip to content

Commit

Permalink
- Added Git related docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Hao Luo committed Feb 13, 2019
1 parent 47e4cdc commit 699352c
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
39 changes: 39 additions & 0 deletions docs/Version Control/Advanced_Git_Notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#Command: git filter-branch
```
$ git filter-branch [--setup <command>] [--subdirectory-filter <directory>] [--env-filter <command>]
[--tree-filter <command>] [--index-filter <command>]
[--parent-filter <command>] [--msg-filter <command>]
[--commit-filter <command>] [--tag-name-filter <command>]
[--original <namespace>]
[-d <directory>] [-f | --force] [--state-branch <branch>]
[--] [<rev-list options>...]
```

#Command: git archive
```
$ git archive [<options>] <tree-ish> [<path>...]
$ git archive --list
$ git archive --remote <repo> [--exec <cmd>] [<options>] <tree-ish> [<path>...]
$ git archive --remote <repo> [--exec <cmd>] --list
--format <fmt> archive format
--prefix <prefix> prepend prefix to each pathname in the archive
-o, --output <file> write the archive to this file
--worktree-attributes
read .gitattributes in working directory
-v, --verbose report archived files on stderr
-0 store only
-1 compress faster
-9 compress better
-l, --list list supported archive formats
--remote <repo> retrieve the archive from remote repository <repo>
--exec <command> path to the remote git-upload-archive command
```

#Command: git reflog
```
$ git reflog [ show | expire | delete | exists ]
```
43 changes: 43 additions & 0 deletions docs/Version Control/Git_General_Notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#Git Global Config Settings
```
[user]
name = FirstName LastName
email = [email]
[color]
ui = auto
[gc]
autoDetach = false
[core]
autocrlf = input
editor = vim
excludesfile = [path_to]/.gitignore_global
[credential]
helper = cache --timeout=10
[status]
submoduleSummary = true
[http]
sslVerify = false
```

#Advanced Commands: git remote
```
# Replace an exist remote URL
$ git remote set-url --add <name> <newurl>
$ git remote set-url [--push] <name> <newurl> [<oldurl>]
# Delete an exist remote URL
$ git remote set-url --delete <name> url>
# Rename an remote
$ git remote rename <old> <new>
$ git remote set-head <name> (-a | --auto | -d | --delete | <branch>)
$ git remote add [-t <branch>] [-m <master>] [-f] [--tags | --no-tags] [--mirror=<fetch|push>] <name> <url>
$ git remote prune [-n | --dry-run] <name>
$ git remote [-v | --verbose] update [-p | --prune] [(<group> | <remote>)...]
$ git remote get-url [--push] [--all] <name>
```

#

0 comments on commit 699352c

Please sign in to comment.