Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to keep compile "at home" apps up to date
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
terrenana
Tux's lil' helper
Tux's lil' helper


Joined: 06 Feb 2021
Posts: 85
Location: Chicago, IL, USA

PostPosted: Fri Oct 14, 2022 11:16 pm    Post subject: How to keep compile "at home" apps up to date Reply with quote

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
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23015

PostPosted: Sat Oct 15, 2022 5:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3477

PostPosted: Sat Oct 15, 2022 9:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
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