Answer the question
In order to leave comments, you need to log in
How to work with Git on two computers from one account?
I know that everything is quite simple and easy to google, but still I'm confused.
There are two computers: work and home. I work with both. What commands to use so that there are no errors?
At work, I write code, commit, push to a remote repository on gitlab. I come home, git pull -> everything is downloaded to the local rep. I work, I push. Everything is in the master. Correctly?
Answer the question
In order to leave comments, you need to log in
It doesn't matter how many computers you work on. You write code on one, commit, then push.
git add my_file.txt
git commit -m 'Updates'
git push origin <branch_name>
git fetch -p
git pull origin <branch_name>
git fetch -p
git reset --hard origin <branch_name>
git fetch -p
git rebase origin <branch_name>
It seems everything is ok. The situation is similar to that if you had this repository lying on one computer in several different directories.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question