Answer the question
In order to leave comments, you need to log in
How to use Git?
Dear developers, I'm waiting for a small tutorial from you on this issue.
I have two computers - MacBook and iMac. I study and program mainly on an iMac, but sometimes I do it not at home, that is, on a MacBook. IDE intelliJ IDEA.
The problem is that I have to constantly take my project, transfer it to a USB flash drive (file sharing), then go in, update, and so on.
I went through several tutorials on Udemy on Git, and still I don’t understand how to synchronize one project on different computers through the console. The question is how to do it?
Answer the question
In order to leave comments, you need to log in
You create an empty turnip on github (without readmy and other proposed files).
You set up an ssh connection to github on both cars.
On any machine in the project folder you create a turnip.
You specify your github as the main remote repository (origin).
Upload all the code to github (git push) Clone
the turnip from github on the second machine
git clone address_of_your_turnip_copied_from_github_interface
Then, after finishing work on any machine, push commits to github (just git push)
Before starting work, pull the actual code to the machine (git pull)
Download Github Desktop. Through it you create a repository. You can not empty, but specify an existing project (the entire folder). Create private if needed. And that's it. On the second machine, you install the same program and clone your repository on this machine as well. After that, it is enough to commit at the end of work on one machine, and on the second press one button to tighten the new changes. All actions are limited to 2 clicks
Good afternoon.
If we are talking specifically about using git, then:
- create a repository on github
- upload your project there
- make commits so that they are visible in the repository git commit -m ""
- add your commits to git git push
- do it on another device git pull
If you want to do this using synchronization, then You can try, for example, cloud storage. All your edits will be uploaded there, and then synchronized with another device. Such a function is, for example, in pCloud.
It is possible that there are more specialized solutions, but these are enough for me.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question