File tree Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Original file line number Diff line number Diff line change 11# Git Basics
22
3+ ## Staging / Committing
341 . Initializing a git repo: ` git init `
452 . Add an untracked file: ` git add file ` . The same command is used to * stage* a tracked modified file.
563 . Check status: ` git status ` . The newly added file is in * modified* state.
896 . If a staged file is modified, the same file will appear under * staged* and * modified* .
9107 . Create a new branch and switch to it : ` git checkout -b branch1 ` .
10118 . See Modified unstaged changes: ` git diff ` (diffs modified and staged)
11- 9 . See staged changes: ` git diff --staged ` (diffs staged and last commit)
12+ 9 . See staged changes: ` git diff --staged ` (diffs staged and last commit)
13+ 10 . Push changes to remote: ` git push `
14+
15+ ## Commit History
16+ 1 . Basic: ` git log `
17+ 2 . See diff of each commit and limit log history to 2: ` git log -p -2 `
18+ 3 . With summary of files modified: ` git log --stat `
19+ 4 . One line : ` git log --oneline `
20+ 5.
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " {{user.name}}" ,
3+ "results" : [ {% for item in results % } " {{item.status}}" , {% endfor % }]
4+ }
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+
3+ from jinja2 import Environment , FileSystemLoader
4+ tpl_vars = {
5+ 'user' :{
6+ 'name' : 'shambhu' ,
7+ },
8+ 'results' :[
9+ { 'status' : 100 },
10+ { 'status' : 200 }
11+ ]
12+ }
13+ if __name__ == '__main__' :
14+ env = Environment (loader = FileSystemLoader ('./templates' ))
15+ template = env .get_template ('config.json' )
16+ print (template .render (tpl_vars ))
17+
You can’t perform that action at this time.
0 commit comments