Git push to live server

后端 未结 6 595
北恋
北恋 2020-12-12 11:11

We have a website that has all its PHP/HTML/JS/CSS/etc files stored in a Git repository.

We currently have 3 types of computers (or use cases) for the repository.

6条回答
  •  天命终不由人
    2020-12-12 12:05

    1. Add remote $ git remote add server ssh://server_hostname:/path/to/git/repo
    2. Checkout temp branch on server $ git checkout -b temp
    3. Push changes $ git push server
    4. Checkout previous branch and delete the temporary one $ git checkout - # shorthand for previous branch, git checkout @{-1} $ git branch -d temp

    I have more background information here: https://medium.com/@2upmedia/git-push-to-live-server-5100406a26

提交回复
热议问题