נבנה על ידיBuilt by Ariel Yohimovich
final_v2_REAL.py זה לא שיטהfinal_v2_REAL.py is not a systemshelf_final_v2.py. Git עושה את זה כמו שצריך: כל commit הוא תמונת מצב עם הסבר, ואפשר לחזור לכל אחת. Git רץ על המחשב שלכם; GitHub הוא אתר שמאחסן את המאגר ברשת. מתקינים מ-git-scm.com (ב-Mac הוא לרוב כבר מותקן), ומגדירים שם ומייל פעם אחת:Without a tool, you keep versions with names like shelf_final_v2.py. Git does it properly: each commit is a snapshot with an explanation, and you can return to any of them. Git runs on your computer; GitHub is a website that hosts the repo online. Install from git-scm.com (on a Mac it's often already there), and set your name and email once:git init יוצר מאגרgit init creates a repogit add → אזור ההכנה (staging)git add → staging areagit commit -m "..." שומרgit commit -m "..." savesgit init הופך את התיקייה למאגר. git add shelf.py מכניס את הקובץ לאזור ההכנה, ו-git commit -m "..." שומר תמונת מצב עם הודעה. git status אומר בכל רגע מה המצב. הפקודות כאן רצו באמת:Three steps. git init turns the folder into a repository. git add shelf.py puts the file in the staging area area, and git commit -m "..." saves a snapshot with a message. git status tells you the state at any moment. These commands really ran:add שם מוצרים בעגלה, ו-commit הוא הקופה. אפשר למלא את העגלה בהדרגה ולשלם פעם אחת.Staging is like a supermarket cart: add puts items in the cart, and commit is the checkout. Fill the cart gradually, pay once.git diff: מה השתנה ועדיין לא נשמרgit diff: what changed and isn't saved yetgit log --oneline: רשימת ה-commitsgit log --oneline: the list of commitsgit diff מראה בדיוק אילו שורות נוספו (+) והוסרו (-). אחרי commit נוסף, git log --oneline מראה את ההיסטוריה: מזהה קצר והודעה לכל commit. הודעה טובה מתחילה בפועל ומסבירה מה השתנה: "Sort books by title", ולא "fix".Changed a file? git diff shows exactly which lines were added (+) and removed (-). After another commit, git log --oneline shows the history: a short id and a message per commit. A good message starts with a verb and says what changed: "Sort books by title", not "fix".git log הוא כמו יומן מסע: כל רשומה אומרת איפה הייתם ומה עשיתם. הודעה כמו "עשיתי דברים" לא תעזור לאף אחד בעוד חודש.git log is like a travel journal: each entry says where you were and what you did. An entry like "did stuff" helps nobody a month later..venv/ ו-__pycache__/Don't save .venv/ and __pycache__/__pycache__ נוצר לבד, וקובץ עם סיסמה או מפתח API לעולם לא נכנס ל-Git: גם אם תמחקו אחר כך, הוא נשאר בהיסטוריה. כותבים את התבניות בקובץ `.gitignore`:Not every file belongs in history. The virtual environment is big and can be recreated, __pycache__ appears on its own, and a file with a password or API key never goes into Git: even if you delete it later, it stays in history. Write the patterns in a `.gitignore` file:git switch -c feature יוצר ענף ועובר אליוgit switch -c feature creates a branch and moves to itgit merge feature מאחדgit merge feature combinesgit remote add origin <url>git remote add origin <url>git push מעלה, git pull מורידgit push uploads, git pull downloadsgit push מעלה commits חדשים ו-git pull מוריד שינויים של אחרים. בפעם הראשונה ההתחברות נעשית בדפדפן או דרך VS Code (Sign in with GitHub). VS Code גם מציג את כל זה בלשונית Source Control.On GitHub you sign up, click New repository, and get an address. Connect your local repo to it once, and from then on git push uploads new commits and git pull downloads others' changes. The first time, you sign in through the browser or VS Code (Sign in with GitHub). VS Code also shows all this in the Source Control tab.final_v2_REAL.py זה לא שיטהfinal_v2_REAL.py is not a systemgit init יוצר מאגרgit init creates a repogit add → אזור ההכנה (staging)git add → staging areagit commit -m "..." שומרgit commit -m "..." savesgit diff: מה השתנה ועדיין לא נשמרgit diff: what changed and isn't saved yetgit log --oneline: רשימת ה-commitsgit log --oneline: the list of commits.venv/ ו-__pycache__/Don't save .venv/ and __pycache__/git switch -c feature יוצר ענף ועובר אליוgit switch -c feature creates a branch and moves to itgit merge feature מאחדgit merge feature combinesgit remote add origin <url>git remote add origin <url>git push מעלה, git pull מורידgit push uploads, git pull downloadsfinal_v2_REAL.py זה לא שיטהfinal_v2_REAL.py is not a systemgit init יוצר מאגרgit init creates a repogit diff: מה השתנה ועדיין לא נשמרgit diff: what changed and isn't saved yet.venv/ ו-__pycache__/Don't save .venv/ and __pycache__/git switch -c feature יוצר ענף ועובר אליוgit switch -c feature creates a branch and moves to itנבנה על ידיBuilt by Ariel Yohimovich