(20241008) logging decorator and model improved.
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
|
||||
# GIT CHEATSHEET
|
||||
## By Sharvil Sir 🙏 (20240927)
|
||||
Perform these steps on creating a new project.
|
||||
|
||||
_**ASSUMPTION:** You are already in your project directory in the command line terminal._
|
||||
|
||||
---
|
||||
|
||||
### STEP 0.
|
||||
#### Initialize Git in your new project:
|
||||
Do this when creating a new project directory.
|
||||
Do this **ONLY ONCE**.
|
||||
```commandline
|
||||
git init
|
||||
```
|
||||
|
||||
### STEP 1.
|
||||
#### Create a `.gitignore` file:
|
||||
Add files/directories in it which you don't want to sync to git.
|
||||
Update this as frequently as your project needs you to. Start with this:
|
||||
```commandline
|
||||
/.venv/
|
||||
/.idea/
|
||||
**/__pycache__/
|
||||
*.pem
|
||||
```
|
||||
|
||||
### STEP 2.
|
||||
#### Create a repository on Gitea (web UI):
|
||||
Do this **ONLY ONCE**.
|
||||
Open the following URL: https://wtt.ditscentre.in/ and sign in.
|
||||
- Ensure that the owner is `ditscentre` (img 0).
|
||||
- Give your repository a name. Preferably keep it the same as the project name that you made locally (img 0).
|
||||
- Type in a brief description of your project (img 0).
|
||||
|
||||

|
||||
|
||||
- Ensure that the default branch is `master` (img 1).
|
||||
- Create the repository (img 1).
|
||||
|
||||

|
||||
|
||||
### STEP 3.
|
||||
#### Add files and directories to the staging area:
|
||||
The following command adds everything to the staging area.
|
||||
The '.' is important, it refers to the current directory.
|
||||
```commandline
|
||||
git add .
|
||||
```
|
||||
|
||||
### STEP 4.
|
||||
#### Commit the changes to local git:
|
||||
This step commits all the added (staged) changes to the local git instance with the provided comment.
|
||||
```commandline
|
||||
git commit -m "you comment here..."
|
||||
```
|
||||
|
||||
### STEP 5.
|
||||
#### We push the local commits to the repository:
|
||||
The format of the command is:
|
||||
```
|
||||
git push -u <repo_url> <branch_name>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## For Python Devs: How to add a common subtree (like `utils_v2`)
|
||||
|
||||
The format of the command is:
|
||||
```
|
||||
git subtree add --prefix=<local_dir> <subtree_repo_url> <branch_name> --squash
|
||||
```
|
||||
Before you start: ensure that you have committed all pending changes. Then run the following command **ONLY ONCE**:
|
||||
```commandline
|
||||
git subtree add --prefix=utils_v2 https://wtt.ditscentre.in/ditscentre/utils_v2.git master --squash
|
||||
```
|
||||
This will create a new directory named `utils_v2` in your project.
|
||||
**Do NOT change the files in it.** Just import and use them in your scripts.
|
||||
When you need to get the latest updates to these files, you must run a modification of the previous command:
|
||||
```commandline
|
||||
git subtree pull --prefix=utils_v2 https://wtt.ditscentre.in/ditscentre/utils_v2.git master --squash
|
||||
```
|
||||
Reference in New Issue
Block a user