Issue
I'm working on a node.js project that I'm hosting on my VPS, so I edit my code on my local PC, then commit it to GitHub. At the moment, to add my changes to my VPS, I delete the old folder and clone it again. The problem with this is that my project uses lots of plugins, so I have to go into the new directory and npm install them all again. Is there a way to just bring in all the changes in the latest commit so it keeps all the plugins installed? Thanks!
Solution
As Steve Tomlin helpfully pointed out, there is a command called git pull [url]
, so the first time, you use git clone https://github.com/whoever/whatever.git
to clone it, but when you update the repository, cd inside the cloned repository, and git pull https://github.com/whoever/whatever.git
. Say you created a new file on GitHub, doing git pull would copy that file onto the client. But also, if in the previous example, on the client you made a new file that you didn't want to commit, git pull
would leave that file as it is, and would not copy, edit or delete that file. Thanks again to Steve Tomlin.
Answered By - Yankue Team Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.