Using two environments pointing at same repo? #159420
-
|
I am a rank noob on github - currently working through the git course on boot.dev. I have a macOS machine and a Linux (Ubuntu) machine, and am tinkering with doing commits on the same project from either. Will this cause clashes? The path from root to the project path is different on each, but the folder for all my git related code is at ~/github_projects on both machines. If I start working on one machine, do a few commits, and then switch to the other machine, develop new code, then commit, will this break the git archive? Are there a set of best practices for this? It is not truly open source, as I am the only person involved, but I am guessing that there is a way to accomplish this, without 'stepping on my own feet' so to speak? Any and all responses are warmly welcomed! ADVthanksANCE |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
|
Git is designed for distributed work, so using both your macOS and Ubuntu boxes on one project won’t break anything—if you keep them in sync.
TL;DRConflicts only appear if you edit the same lines on both machines without pulling first. Follow the rhythm above and your repository—and sanity—remain intact. |
Beta Was this translation helpful? Give feedback.
-
|
Hey @Grumpster-Dev, General Workflow AdviceAs long as you consistently pull and push changes, you won’t break anything. Git is made for version control across multiple devices, users, and branches, even if the folder paths differ between systems.
This ensures both machines stay in sync and you don’t run into merge conflicts, or at least you keep them easy to manage. On Dependencies (like React or Node.js projects)If you're using tools like React and installing dependencies (e.g., So when switching machines:
Best Practices for Solo Cross-Device DevelopmentHere are a few tips to keep things smooth:
GitHub isn’t going to break if you push from two places. Even if you do run into a merge conflict (say you edited the same file differently on both machines), Git will clearly tell you and let you resolve it. You're not “stepping on your own feet” you're learning to juggle tools like a pro :). Just keep that push/pull flow in mind, and you’ll be fine. Basically: |
Beta Was this translation helpful? Give feedback.
hi @Grumpster-Dev
Git is designed for distributed work, so using both your macOS and Ubuntu boxes on one project won’t break anything—if you keep them in sync.
Single Source of Truth
Host one remote repo (e.g., on GitHub) and clone it on each machine.
Identify Yourself Once
git config --global user.name "Your Name" git config --global user.email you@example.comBefore You Code
git pull # grab any commits pushed from the other computerAfter You Code
Ignore OS Junk
Add items like
.DS_Storeor*~to.gitignore.Mind Case Sensitivity
macOS (default) is case-insensitive; Linu…