ccncio commited on
Commit
3bc16cc
·
1 Parent(s): 5a63659

added ap.py

Browse files
Files changed (2) hide show
  1. app.py +1 -11
  2. git-war-chest.md +160 -0
app.py CHANGED
@@ -1,18 +1,8 @@
1
  import gradio as gr
2
 
3
- def quantum_freedom(text):
4
- return f"QuantumFreedom(); processes: {text}"
5
-
6
- app = gr.Interface(
7
- fn=quantum_freedom,
8
- inputs="text",
9
- outputs="text",
10
- title="QuantumFreedom",
11
- description="Enter text to interact with QuantumFreedom();"
12
- )import gradio as gr
13
-
14
  def greet(name):
15
  return "Hello " + name + "!!"
16
 
17
  demo = gr.Interface(fn=greet, inputs="text", outputs="text")
18
  demo.launch()
 
 
1
  import gradio as gr
2
 
 
 
 
 
 
 
 
 
 
 
 
3
  def greet(name):
4
  return "Hello " + name + "!!"
5
 
6
  demo = gr.Interface(fn=greet, inputs="text", outputs="text")
7
  demo.launch()
8
+
git-war-chest.md ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Here's a **brutal, no-nonsense breakdown** of all essential Git commands so you have them at your fingertips. No fluff—just raw execution.
2
+
3
+ ---
4
+
5
+ ## **🔹 GIT ESSENTIALS**
6
+ ### **1️⃣ Setup & Config**
7
+ ```sh
8
+ git config --global user.name "Your Name"
9
+ git config --global user.email "you@example.com"
10
+ ```
11
+ - Sets your global Git username and email.
12
+ - Required for committing.
13
+
14
+ ### **2️⃣ Clone a Repo**
15
+ ```sh
16
+ git clone <repo_url>
17
+ ```
18
+ - Pulls a remote repo to your local machine.
19
+
20
+ ---
21
+
22
+ ## **🔹 WORKING WITH CHANGES**
23
+ ### **3️⃣ Check Status**
24
+ ```sh
25
+ git status
26
+ ```
27
+ - Shows uncommitted, unstaged, and untracked files.
28
+
29
+ ### **4️⃣ Add Files to Staging**
30
+ ```sh
31
+ git add <file> # Add a single file
32
+ git add . # Add everything (current directory)
33
+ ```
34
+ - Moves changes from the working directory to the **staging area**.
35
+
36
+ ### **5️⃣ Commit Changes**
37
+ ```sh
38
+ git commit -m "Your commit message"
39
+ ```
40
+ - Saves staged changes to the local repository.
41
+
42
+ ### **6️⃣ Modify Last Commit**
43
+ ```sh
44
+ git commit --amend -m "Updated commit message"
45
+ ```
46
+ - Edits the last commit message before pushing.
47
+
48
+ ---
49
+
50
+ ## **🔹 WORKING WITH REMOTE REPOS**
51
+ ### **7️⃣ Check Remote Repo**
52
+ ```sh
53
+ git remote -v
54
+ ```
55
+ - Shows the connected remote repo(s).
56
+
57
+ ### **8️⃣ Push to Remote**
58
+ ```sh
59
+ git push origin main # Push to the main branch
60
+ git push -u origin <branch> # Push a new branch and set upstream
61
+ ```
62
+ - Sends local commits to the remote repo.
63
+
64
+ ### **9️⃣ Pull Latest Changes**
65
+ ```sh
66
+ git pull origin main
67
+ ```
68
+ - Updates your local branch with the latest remote changes.
69
+
70
+ ### **🔟 Fetch Changes (Without Merging)**
71
+ ```sh
72
+ git fetch origin
73
+ ```
74
+ - Downloads remote changes but doesn’t apply them.
75
+
76
+ ---
77
+
78
+ ## **🔹 BRANCH MANAGEMENT**
79
+ ### **1️⃣1️⃣ Create a New Branch**
80
+ ```sh
81
+ git checkout -b <new-branch>
82
+ ```
83
+ - Creates and switches to a new branch.
84
+
85
+ ### **1️⃣2️⃣ Switch Branches**
86
+ ```sh
87
+ git checkout <branch>
88
+ ```
89
+ - Moves to another branch.
90
+
91
+ ### **1️⃣3️⃣ Merge a Branch**
92
+ ```sh
93
+ git checkout main
94
+ git merge <branch>
95
+ ```
96
+ - Merges `<branch>` into `main`.
97
+
98
+ ### **1️⃣4️⃣ Delete a Branch**
99
+ ```sh
100
+ git branch -d <branch> # Delete locally
101
+ git push origin --delete <branch> # Delete remotely
102
+ ```
103
+
104
+ ---
105
+
106
+ ## **🔹 FIXING MISTAKES**
107
+ ### **1️⃣5️⃣ Reset Last Commit**
108
+ ```sh
109
+ git reset --soft HEAD~1 # Undo commit, keep changes
110
+ git reset --hard HEAD~1 # Undo commit AND delete changes
111
+ ```
112
+
113
+ ### **1️⃣6️⃣ Discard Uncommitted Changes**
114
+ ```sh
115
+ git checkout -- <file>
116
+ ```
117
+ - Resets a file to the last committed version.
118
+
119
+ ### **1️⃣7️⃣ Stash Uncommitted Work**
120
+ ```sh
121
+ git stash # Save work without committing
122
+ git stash pop # Apply last stash
123
+ git stash drop # Remove last stash
124
+ ```
125
+
126
+ ---
127
+
128
+ ## **🔹 FORCING CHANGES (USE WITH CAUTION)**
129
+ ### **1️⃣8️⃣ Force Push (If Remote is Ahead)**
130
+ ```sh
131
+ git push --force origin main
132
+ ```
133
+ - Overwrites the remote branch.
134
+
135
+ ### **1️⃣9️⃣ Hard Reset to Remote**
136
+ ```sh
137
+ git reset --hard origin/main
138
+ ```
139
+ - Resets local branch to match remote exactly.
140
+
141
+ ---
142
+
143
+ ## **🔹 DEBUGGING & HISTORY**
144
+ ### **2️⃣0️⃣ View Commit History**
145
+ ```sh
146
+ git log --oneline --graph --decorate --all
147
+ ```
148
+ - Shows a concise commit history.
149
+
150
+ ### **2️⃣1️⃣ View Changes in a File**
151
+ ```sh
152
+ git diff <file>
153
+ ```
154
+ - Compares current changes to the last commit.
155
+
156
+ ---
157
+
158
+ This is your **Git war chest**. You now have **every weapon** needed to destroy deployment headaches, recover from mistakes, and keep everything under control.
159
+
160
+ Need more? Hit me up.