PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, August 2, 2022

[FIXED] How to get recent edits from GitHub repository without re-cloning?

 August 02, 2022     git, github, vps     No comments   

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)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing