View previous topic :: View next topic |
Author |
Message |
terrenana Tux's lil' helper
Joined: 06 Feb 2021 Posts: 85 Location: Chicago, IL, USA
|
Posted: Fri Oct 14, 2022 11:16 pm Post subject: How to keep compile "at home" apps up to date |
|
|
Hi All,
I have a question (which seems sort of silly but I don't know how to look it up), if I have a program like st, where you clone the git repo from a place other than github (meaning you can't fork it), then you apply your own changes (in the form of st patches and changes to config files), How do you then update st. If you sync with upstream will your local edits be overwritten? Also, if the code IS on github, should you fork the code to get your own personal repo to host your edited configs and patched files? I usually have all my configs in git repos anyways I'm just wondering how to sync that with upstream when its time to update.
Thanks! _________________ what should i put here? |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 23017
|
Posted: Sat Oct 15, 2022 5:42 pm Post subject: |
|
|
There is no git command sync, so we would need to know which command you plan to use. If you git checkout or git reset --hard, then yes, your changes are lost. If you git merge or git rebase, then your changes are kept, subject to manual conflict resolution.
Forking on github is only to provide a public mirror of your work. If you have no plans to share your changes, there is no need to create your own fork. Just clone the github repository and maintain your work locally. |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3477
|
Posted: Sat Oct 15, 2022 9:56 pm Post subject: |
|
|
Quote: | if I have a program like st, where you clone the git repo from a place other than github (meaning you can't fork it), then you apply your own changes (in the form of st patches and changes to config files), How do you then update st. | You can fork it.
Git clone creates your personal, local fork. There is no requirement to publish it.
Git also has branches, which may or may not be convenient for you, since managing local branches is easy and managing remote branches not so much, but requires more steps for every merge (for sake of getting out of binds easier)
git clone
git checkout -b my_changes
Apply your changes in your local branch.
Update would be like:
git checkout master
git pull
git checkout my_changes
git rebase master
Alternatively you can roll with just a single local branch and use git pull --rebase instead of all those checkouts and manual merges, but the more changes you have the more likely things are to go wrong, and they will be more difficult to fix, so weight your safety against convenience. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|