ERPNext Migration

Hi, I need to build some doctypes inside ERPNext. As I also want to use entire ERPNext system I can’t build another app for it.
The issue occurs when I migrate code from local to server or another PC.
How can I migrate the updated code.
I have set it up locally and on server. But when I change the Git origin from Frappe to my own it doesn’t work.
Gives a lot errors.
Can you please guide me how can I accomplish this?
What am I doing wrong in the process.
Thanks.