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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Git Workflow for Hugging Face Repository
|
| 2 |
+
|
| 3 |
+
Your Hugging Face repository is now cloned and works **exactly like GitHub**! You can use all the standard git commands.
|
| 4 |
+
|
| 5 |
+
## π Repository Location
|
| 6 |
+
```
|
| 7 |
+
/Users/liliana/Research/CMU/Isayev/Projects/Collaborations/Bernhard_Amide-coupling/Publish/prism_hf_repo
|
| 8 |
+
```
|
| 9 |
+
|
| 10 |
+
## π Basic Workflow (Just Like GitHub)
|
| 11 |
+
|
| 12 |
+
### 1. Check Status
|
| 13 |
+
See what files have changed:
|
| 14 |
+
```bash
|
| 15 |
+
cd prism_hf_repo
|
| 16 |
+
git status
|
| 17 |
+
```
|
| 18 |
+
|
| 19 |
+
### 2. Add Files
|
| 20 |
+
Stage files for commit (like `git add` in GitHub):
|
| 21 |
+
|
| 22 |
+
**Add a specific file:**
|
| 23 |
+
```bash
|
| 24 |
+
git add qm_calculations/new_file.xyz
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
**Add all files in a directory:**
|
| 28 |
+
```bash
|
| 29 |
+
git add qm_calculations/
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
**Add all changes:**
|
| 33 |
+
```bash
|
| 34 |
+
git add .
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
### 3. Commit Changes
|
| 38 |
+
Save your changes with a message:
|
| 39 |
+
```bash
|
| 40 |
+
git commit -m "Add new quantum calculations"
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
### 4. Push to Hugging Face
|
| 44 |
+
Upload your changes (like `git push` in GitHub):
|
| 45 |
+
```bash
|
| 46 |
+
git push
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
That's it! Your changes are now live on Hugging Face! π
|
| 50 |
+
|
| 51 |
+
---
|
| 52 |
+
|
| 53 |
+
## π Common Operations
|
| 54 |
+
|
| 55 |
+
### Add a New File
|
| 56 |
+
```bash
|
| 57 |
+
cd prism_hf_repo
|
| 58 |
+
cp ~/my_new_file.xyz qm_calculations/
|
| 59 |
+
git add qm_calculations/my_new_file.xyz
|
| 60 |
+
git commit -m "Add new XYZ structure"
|
| 61 |
+
git push
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
### Add Multiple Files
|
| 65 |
+
```bash
|
| 66 |
+
cd prism_hf_repo
|
| 67 |
+
cp -r ~/new_data_folder qm_calculations/
|
| 68 |
+
git add qm_calculations/new_data_folder/
|
| 69 |
+
git commit -m "Add new data folder"
|
| 70 |
+
git push
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
### Edit a File
|
| 74 |
+
```bash
|
| 75 |
+
cd prism_hf_repo
|
| 76 |
+
nano qm_calculations/README.md # or use any editor
|
| 77 |
+
git add qm_calculations/README.md
|
| 78 |
+
git commit -m "Update README"
|
| 79 |
+
git push
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
### Delete a File
|
| 83 |
+
```bash
|
| 84 |
+
cd prism_hf_repo
|
| 85 |
+
git rm qm_calculations/old_file.xyz
|
| 86 |
+
git commit -m "Remove old file"
|
| 87 |
+
git push
|
| 88 |
+
```
|
| 89 |
+
|
| 90 |
+
### Delete a Folder
|
| 91 |
+
```bash
|
| 92 |
+
cd prism_hf_repo
|
| 93 |
+
git rm -r qm_calculations/old_folder/
|
| 94 |
+
git commit -m "Remove old folder"
|
| 95 |
+
git push
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
### Rename/Move Files
|
| 99 |
+
```bash
|
| 100 |
+
cd prism_hf_repo
|
| 101 |
+
git mv qm_calculations/old_name.xyz qm_calculations/new_name.xyz
|
| 102 |
+
git commit -m "Rename file"
|
| 103 |
+
git push
|
| 104 |
+
```
|
| 105 |
+
|
| 106 |
+
---
|
| 107 |
+
|
| 108 |
+
## π Syncing Changes
|
| 109 |
+
|
| 110 |
+
### Pull Latest Changes
|
| 111 |
+
If someone else made changes, or you edited on the web:
|
| 112 |
+
```bash
|
| 113 |
+
cd prism_hf_repo
|
| 114 |
+
git pull
|
| 115 |
+
```
|
| 116 |
+
|
| 117 |
+
### See What Changed
|
| 118 |
+
```bash
|
| 119 |
+
git log # See commit history
|
| 120 |
+
git log --oneline # Compact view
|
| 121 |
+
git diff # See unstaged changes
|
| 122 |
+
git diff --staged # See staged changes
|
| 123 |
+
```
|
| 124 |
+
|
| 125 |
+
---
|
| 126 |
+
|
| 127 |
+
## π― Example Workflow
|
| 128 |
+
|
| 129 |
+
Let's say you want to add a new XYZ file:
|
| 130 |
+
|
| 131 |
+
```bash
|
| 132 |
+
# 1. Navigate to the repo
|
| 133 |
+
cd /Users/liliana/Research/CMU/Isayev/Projects/Collaborations/Bernhard_Amide-coupling/Publish/prism_hf_repo
|
| 134 |
+
|
| 135 |
+
# 2. Copy your file
|
| 136 |
+
cp ~/my_calculation.xyz qm_calculations/hammett_XYZs/
|
| 137 |
+
|
| 138 |
+
# 3. Check status (optional but recommended)
|
| 139 |
+
git status
|
| 140 |
+
|
| 141 |
+
# 4. Stage the file
|
| 142 |
+
git add qm_calculations/hammett_XYZs/my_calculation.xyz
|
| 143 |
+
|
| 144 |
+
# 5. Commit
|
| 145 |
+
git commit -m "Add new Hammett calculation for compound X"
|
| 146 |
+
|
| 147 |
+
# 6. Push to Hugging Face
|
| 148 |
+
git push
|
| 149 |
+
|
| 150 |
+
# Done! View at: https://huggingface.co/datasets/gomesgroup/prism
|
| 151 |
+
```
|
| 152 |
+
|
| 153 |
+
---
|
| 154 |
+
|
| 155 |
+
## π§ Advanced Operations
|
| 156 |
+
|
| 157 |
+
### Undo Uncommitted Changes
|
| 158 |
+
```bash
|
| 159 |
+
git checkout -- file.xyz # Discard changes to a file
|
| 160 |
+
git reset --hard # Discard all uncommitted changes (careful!)
|
| 161 |
+
```
|
| 162 |
+
|
| 163 |
+
### Undo Last Commit (Before Push)
|
| 164 |
+
```bash
|
| 165 |
+
git reset --soft HEAD~1 # Undo commit, keep changes staged
|
| 166 |
+
git reset --mixed HEAD~1 # Undo commit, unstage changes
|
| 167 |
+
git reset --hard HEAD~1 # Undo commit and discard changes (careful!)
|
| 168 |
+
```
|
| 169 |
+
|
| 170 |
+
### View File History
|
| 171 |
+
```bash
|
| 172 |
+
git log qm_calculations/file.xyz # See commits affecting this file
|
| 173 |
+
git show <commit-hash>:file.xyz # View file at specific commit
|
| 174 |
+
```
|
| 175 |
+
|
| 176 |
+
### Create a Branch (Optional)
|
| 177 |
+
```bash
|
| 178 |
+
git checkout -b new-feature # Create and switch to branch
|
| 179 |
+
git add .
|
| 180 |
+
git commit -m "Add feature"
|
| 181 |
+
git push origin new-feature # Push branch
|
| 182 |
+
```
|
| 183 |
+
|
| 184 |
+
---
|
| 185 |
+
|
| 186 |
+
## π Quick Reference Table
|
| 187 |
+
|
| 188 |
+
| Git Command | What It Does | Like GitHub? |
|
| 189 |
+
|-------------|--------------|--------------|
|
| 190 |
+
| `git status` | Check what changed | β
Yes |
|
| 191 |
+
| `git add <file>` | Stage file for commit | β
Yes |
|
| 192 |
+
| `git commit -m "msg"` | Save changes locally | β
Yes |
|
| 193 |
+
| `git push` | Upload to Hugging Face | β
Yes, exactly! |
|
| 194 |
+
| `git pull` | Download latest changes | β
Yes |
|
| 195 |
+
| `git rm <file>` | Delete file | β
Yes |
|
| 196 |
+
| `git mv <old> <new>` | Rename/move file | β
Yes |
|
| 197 |
+
| `git log` | View history | β
Yes |
|
| 198 |
+
|
| 199 |
+
---
|
| 200 |
+
|
| 201 |
+
## π‘ Tips
|
| 202 |
+
|
| 203 |
+
1. **Always `git pull` before making changes** if you might have edited on the web
|
| 204 |
+
2. **Use descriptive commit messages** so you know what changed later
|
| 205 |
+
3. **Commit often** - small, frequent commits are better than large ones
|
| 206 |
+
4. **Check `git status`** before committing to see what will be included
|
| 207 |
+
5. **Large files**: Hugging Face uses Git LFS automatically for large files
|
| 208 |
+
|
| 209 |
+
---
|
| 210 |
+
|
| 211 |
+
## π View Your Repository Online
|
| 212 |
+
|
| 213 |
+
After pushing, view your changes at:
|
| 214 |
+
**https://huggingface.co/datasets/gomesgroup/prism**
|
| 215 |
+
|
| 216 |
+
---
|
| 217 |
+
|
| 218 |
+
## π Troubleshooting
|
| 219 |
+
|
| 220 |
+
### Push Rejected?
|
| 221 |
+
```bash
|
| 222 |
+
git pull --rebase # Get latest changes first
|
| 223 |
+
git push # Try again
|
| 224 |
+
```
|
| 225 |
+
|
| 226 |
+
### Accidentally Added Wrong File?
|
| 227 |
+
```bash
|
| 228 |
+
git reset HEAD file.xyz # Unstage file before commit
|
| 229 |
+
git rm --cached file.xyz # Remove from staging, keep local copy
|
| 230 |
+
```
|
| 231 |
+
|
| 232 |
+
### Want to Start Fresh?
|
| 233 |
+
```bash
|
| 234 |
+
cd /Users/liliana/Research/CMU/Isayev/Projects/Collaborations/Bernhard_Amide-coupling/Publish
|
| 235 |
+
rm -rf prism_hf_repo
|
| 236 |
+
git clone https://gomesgroup:YOUR_TOKEN@huggingface.co/datasets/gomesgroup/prism prism_hf_repo
|
| 237 |
+
```
|
| 238 |
+
|
qm_calculations/README.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# QM Calculations
|
| 2 |
+
|
| 3 |
+
This directory contains quantum mechanical calculations for the amide coupling project.
|