Home > Software engineering >  how can I easily apply my changes to a cloned github repository?
how can I easily apply my changes to a cloned github repository?

Time:04-24

I'm working on a project, but the github repository my foundation comes from updates frequently. It's written in C with a Lua interpreter. I want to be able to update my local repository, and apply my changes to the local source code as easily as possible. Right now, I comment the changes I make, and then using Notepad , I search through all the source files for my comments, and then I transfer the code to the updated project. I have over 100 comments to sift through, which leaves me wondering if there is a better way to do it. I'm thinking, one option, I can make a new folder for my local source, with different files for different functions, and include them in the main source, making less comments to sift through. Would this be the best approach?

CodePudding user response:

Basically git is a tool for managing different versions of software and you can just use it.

Make a branch for your changes:

git checkout -b jay

Whenever you have made some progress worth saving, make a commit:

git commit -am "Good changes."

When you want to update your branch with the latest changes from upstream, do a pull or merge operation. Something like:

git pull origin master

If there are conflicts during the merge, git will tell you about them and help you resolve them. As long as you don't do the risky operation known as "rebase", you can always get back to your previous commits if something goes wrong in the merge.

  •  Tags:  
  • git
  • Related