简体   繁体   中英

How to use git to do version control when I edit my code in Windows but build and run my code in Linux (using pycharm)

I have a question that I edit my code using PyCharm in Windows platform, and build and run my code in Linux machine, I want to know what is the correct way to do version control using git? My current approach is

  1. using git in Windows
  2. build and run code in Linux
  3. checkout different branches in Windows and upload code to Linux(and not upload binary files such as .o files and .so files)

I'm not quite comfortable with this approach so I want to know the better ways. Thank you!

and upload code to Linux

If your Linux machine is accessible through SSH (and has Git installed), a better option would be to git push your code to your Linux machine, using a:

  • bare repository
  • a post-receive hook to checkout/restore your code where you want on said Linux server.

You can see an example here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM