<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Git on Janusworx</title><link>https://janusworx.com/tags/git/</link><description>Recent content in Git on Janusworx</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>feedback@janusworx.com (Mario Jason Braganza)</managingEditor><webMaster>feedback@janusworx.com (Mario Jason Braganza)</webMaster><copyright>© 2026, Mario Jason Braganza</copyright><lastBuildDate>Sat, 28 Sep 2024 15:39:12 +0530</lastBuildDate><atom:link href="https://janusworx.com/tags/git/index.xml" rel="self" type="application/rss+xml"/><item><title>Forgejo</title><link>https://janusworx.com/work/forgejo/</link><pubDate>Sat, 28 Sep 2024 15:39:12 +0530</pubDate><author>feedback@janusworx.com (Mario Jason Braganza)</author><guid>https://janusworx.com/work/forgejo/</guid><description>&lt;p&gt;Setup a new instance of Forgejo for myself today.&lt;br&gt;
The first thing I felt, was … instant relief.&lt;br&gt;
I didn’t realise just how much cognitive discomfort I was feeling, because Github was the only place I had all my code. As well as mirrors/forks of all the stuff I loved.&lt;br&gt;
I’m going to slowly move over to my little Forgejo instance as I learn more.&lt;/p&gt;
&lt;p&gt;Right now I’ve set up pull mirrors for all the projects I love.
&lt;br&gt;
&lt;/p&gt;

&lt;figure&gt;
 &lt;img class="my-0 rounded-md" src="https://janusworx.com/images/2024/forgejo.png" alt="" /&gt;
 
 
 &lt;/figure&gt;
&lt;hr style='margin-left: auto; margin-right: auto; margin-bottom: 40px; margin-top: 50px; width:100px; border: none; background-color:rgb(238, 238, 238); color: rgb(238, 238, 238); height: 1px;'/&gt;

&lt;p&gt;Next step is to figure out how to automate my Hugo blog deployment and more importantly; having all my posts in source control.&lt;/p&gt;
&lt;p&gt;&lt;hr style='margin-left: auto; margin-right: auto; margin-bottom: 40px; margin-top: 50px; width:100px; border: none; background-color:rgb(238, 238, 238); color: rgb(238, 238, 238); height: 1px;'/&gt;

Feedback on this post?&lt;br&gt;
Mail me at &lt;a href="mailto:feebdback@janusworx.com?subject=%22Feedback on post: Forgejo
%22" &gt;feedback at this domain&lt;/a&gt; &lt;em&gt;or&lt;/em&gt; [continue the discourse here][3].
&lt;br&gt;

&lt;br&gt;

P.S. Subscribe to my &lt;a href="https://janusworx.com/subscribe/" target="_blank" rel="noreferrer"&gt;mailing list!&lt;/a&gt;&lt;br&gt;
Forward these posts and letters to your friends and get them to subscribe!&lt;br&gt;
P.P.S. Feed my &lt;a href="https://www.amazon.in/hz/wishlist/ls/2QAUKHHAMOOVS?ref_=wl_share" target="_blank" rel="noreferrer"&gt;insatiable reading habit.&lt;/a&gt;&lt;/p&gt;</description></item><item><title>A Rambling, Only Slightly Coherent Chat Around Git, Commits, and Stashing</title><link>https://janusworx.com/work/a-rambling-only-slightly-coherent-chat-around-git/</link><pubDate>Wed, 03 Mar 2021 11:25:06 +0530</pubDate><author>feedback@janusworx.com (Mario Jason Braganza)</author><guid>https://janusworx.com/work/a-rambling-only-slightly-coherent-chat-around-git/</guid><description>&lt;p&gt;What do I do, when I don’t understand the vagaries of tech?&lt;br&gt;
Why? I ask my friends to drum some sense into me.&lt;br&gt;
As I write more code, I wanted to get some sense of the cultural norms about how to use git.&lt;br&gt;
So I asked my young friends, &lt;a href="https://naba.run/" target="_blank" rel="noreferrer"&gt;Nabarun&lt;/a&gt; and &lt;a href="https://yudocaa.in/" target="_blank" rel="noreferrer"&gt;Sayan&lt;/a&gt; all sorts of dumbass questions.&lt;/p&gt;
&lt;p&gt;Here it is, warts and all for posterity (but lightly edited).&lt;br&gt;
If you’d love to come teach me or be part of the conversation, head on over to the IRC &lt;a href="https://webchat.freenode.net/" target="_blank" rel="noreferrer"&gt;#learnandteach&lt;/a&gt; channel on the freenode server.&lt;/p&gt;
&lt;!-- TEASER_END --&gt;
&lt;hr style="margin-left: auto; margin-right: auto;margin-bottom: 40px; width:100px; border: none; background-color:rgb(238, 238, 238); color: rgb(238, 238, 238); height: 1px;" /&gt; 
&lt;p&gt;jasonbraganza: nabarun, sayan - as i keep practicing writing code more, i find myself doing a daily git branch off the previous days branch because I want each day’s progress. is this normal practice? or ok behaviour? XD&lt;br&gt;
sayan: Nope! rather than branch you can have daily commits&lt;br&gt;
nabarun: same thoughts ^^^&lt;br&gt;
nabarun: have commits as your checkpoints instead of branches&lt;br&gt;
jasonbraganza: ok. :)&lt;br&gt;
nabarun: and then everyday or any day in future you can look at commit diffs&lt;br&gt;
sayan: exactly&lt;br&gt;
sayan: you can branch off to create a backup of the commits, if you want to&lt;br&gt;
jasonbraganza: what if i have too many commits?&lt;br&gt;
sayan: but before sending that work to any open source projects, squash or rearrange them&lt;br&gt;
jasonbraganza: ok i should learn that too.&lt;br&gt;
jasonbraganza: thank you both :)&lt;br&gt;
jasonbraganza: if anymore advice, i’m still all ears.&lt;br&gt;
sayan: When you are working on a big work, and you send of to review it is beneficial to arrange the commits in a way that reviewers can go through the commits&lt;br&gt;
sayan: and the whole history feels like a story&lt;br&gt;
jasonbraganza: i don’t understand. are you telling me it is possible to arrange commits in a manner other than chronological?&lt;br&gt;
jasonbraganza: or if you pointed me someplace you like the story, maybe i’ll understand better.&lt;br&gt;
sayan: I&amp;rsquo;m looking for a PR in fedora repo, I will see if I find but there is a smaller one that I did&lt;br&gt;
jasonbraganza: thank you.&lt;br&gt;
sayan: &lt;a href="https://github.com/coreos/mantle/pull/934/commits" target="_blank" rel="noreferrer"&gt;https://github.com/coreos/mantle/pull/934/commits&lt;/a&gt;&lt;br&gt;
sayan: There are only 3 commits here, but first commit adds the provision to add new systems, then add dependency that the new system I will add will need, and then add the new system&lt;br&gt;
sayan: jasonbraganza: found the PR: &lt;a href="https://pagure.io/fedora-hubs/pull-request/323" target="_blank" rel="noreferrer"&gt;https://pagure.io/fedora-hubs/pull-request/323&lt;/a&gt;&lt;br&gt;
sayan: this commit had 45 commits, if you had idea of the project then when you read the commits in order, old to new, it would make sense how the PR evolves&lt;br&gt;
sayan: There is this comment as well in description&lt;br&gt;
sayan: I recognize that it&amp;rsquo;s a big change, so I&amp;rsquo;d like to add the following :&lt;br&gt;
sayan: try to read commits in order, I&amp;rsquo;ve made them topic-specific, so you can understand what&amp;rsquo;s being changed and why. Reading the whole &amp;ldquo;Files changed&amp;rdquo; page is actually much harder.&lt;br&gt;
jasonbraganza: now i understand.&lt;br&gt;
jasonbraganza: i think it boils down to a difference in how i think about git&lt;br&gt;
sayan: This you cannot do when you code, this is often done later, or at intervals when you keep arranging the commits&lt;br&gt;
jasonbraganza: that is what i was getting to ^&lt;br&gt;
jasonbraganza: when i code, i want to do it iteratively&lt;br&gt;
sayan: When I work if it&amp;rsquo;s a big work, I just keep creating &amp;ldquo;Tmp commits&amp;rdquo;&lt;br&gt;
jasonbraganza: and that probably could mean me jumping up and down all over the place.&lt;br&gt;
sayan: &amp;ldquo;Tmp commits is actually the commit message :)&lt;br&gt;
jasonbraganza: and since i am paranoid, i keep committing my work&lt;br&gt;
sayan: jasonbraganza: doing regular commits is always good&lt;br&gt;
jasonbraganza: so if i understand it right, you say that i can then change the order of my commits when i push to someplace remote, in a way that it all makes sense?&lt;br&gt;
sayan: jasonbraganza: see this &lt;a href="https://github.com/kinvolk/coreos-overlay/commit/7fb8a7258c4dbd61d512c831272b3ebb36cf2e45" target="_blank" rel="noreferrer"&gt;https://github.com/kinvolk/coreos-overlay/commit/7fb8a7258c4dbd61d512c831272b3ebb36cf2e45&lt;/a&gt;&lt;br&gt;
jasonbraganza: ^ that resembles more of my workflow :)&lt;br&gt;
sayan: jasonbraganza: you can push whatever you want to the remote, but when you create the pull request at the end of the day it should make sense to the reviewers&lt;br&gt;
jasonbraganza: aha. so that is the missing piece.&lt;br&gt;
sayan: A pull request can be after say 1 week or 2 months, but commits you can do hourly, daily etc&lt;br&gt;
jasonbraganza: will ask you to help, whenever i do this next time.&lt;br&gt;
jasonbraganza: thank you sayan :)&lt;br&gt;
sayan: jasonbraganza: sure&lt;br&gt;
sayan: jasonbraganza: another idea, sometimes you might find yourself writing 1000 lines of code in an hour, and sometimes 5 lines in an hour&lt;br&gt;
jasonbraganza: and obviously since I write, I am obviously a big fan of someone leading me to a conclusion in a logical flow ergo i am heavily in favour of writing stories in code as well&lt;br&gt;
jasonbraganza: sayan, hmm true. go on&lt;br&gt;
sayan: in the former case you should commit every 2-3 minutes, and in the later case you can do a daily commit. People say to regularly commit because it&amp;rsquo;s hard to lose things when it is committed in git&lt;br&gt;
jasonbraganza: ok. that makes sense. thank you :)&lt;br&gt;
sayan: np :)&lt;br&gt;
jasonbraganza: as for committing regularly, i am always scared of having to redo my work or losing it. so that is something i do religiously :)&lt;br&gt;
sayan: jasonbraganza: same here, and probably same for all&lt;br&gt;
sayan: once I wrote a 100 lines of code over 2-3 days, lost because I did not commit&lt;br&gt;
sayan: I was happy to get the code from stash&lt;br&gt;
sayan: From that day, I just keep creating tmp commits&lt;br&gt;
jasonbraganza: question, only files that are added are in stash, correct? if i create a new file, that won’t be there?&lt;br&gt;
sayan: jasonbraganza: yes, new files won&amp;rsquo;t be there.&lt;br&gt;
sayan: I was lucky, that I do &lt;code&gt;stash apply&lt;/code&gt; and not &lt;code&gt;stash pop&lt;/code&gt;&lt;br&gt;
jasonbraganza: thank you sayan. my mental model of git grows clearer by the day :)&lt;br&gt;
jasonbraganza: apply if i intuit correctly, will pull everything from stash, whereas pop will get me the newest one?&lt;br&gt;
jasonbraganza: sayan, nabarun also, do i have y’alls permission to put this conversation on the blog? might help some other newbie?&lt;br&gt;
sayan: jasonbraganza: kushal has been asking me to write a git book for years atleast 5-6 years&lt;br&gt;
sayan: jasonbraganza: apply stash n: will apply the patch but also keep a copy in the stash list&lt;br&gt;
jasonbraganza: maybe i should pull it out of you by asking questions like these XD&lt;br&gt;
sayan: jasonbraganza: pop will pop the last and also remove from stash list&lt;br&gt;
sayan: last = newest one, as you said&lt;br&gt;
jasonbraganza: where n is any random number in the stash?&lt;br&gt;
sayan: yes, in stash list&lt;br&gt;
jasonbraganza: understood :)&lt;br&gt;
nabarun: nabarun: sure. although I have not contributed much here. :)&lt;br&gt;
nabarun: jasonbraganza: ^^^&lt;br&gt;
sayan: every time you do &lt;code&gt;git stash&lt;/code&gt;, it puts it in stash. &lt;code&gt;git stash list&lt;/code&gt; will give you all in stash&lt;br&gt;
jasonbraganza: nabarun, consent matters :)&lt;br&gt;
nabarun: jasonbraganza: it does!&lt;br&gt;
nabarun: git stash pop == git stash apply 0 &amp;amp;&amp;amp; git stash drop 0&lt;br&gt;
sayan: ^^ +1&lt;br&gt;
jasonbraganza: why would you do a git stash as opposed to a git commit?&lt;br&gt;
nabarun: jasonbraganza: for cases where we want to stash our work aside to work on something else in the working space.&lt;br&gt;
sayan: jasonbraganza: not yet prepared like a commit, or moving around branches&lt;br&gt;
sayan: jasonbraganza: but you can do a tmp commit as well&lt;br&gt;
sayan: jasonbraganza: stash is quicker when you want to move around branches&lt;br&gt;
nabarun: jasonbraganza: IRL example, I am working on lubing my keyboard switches but realize that it&amp;rsquo;s work time. So, stash that aside and start working on my work stuff. When my work gets over, I can pop things off my stash of unfinished work.&lt;br&gt;
sayan: also suppose you want to rebase, and have changes. If you don&amp;rsquo;t have autostash then you have to stash manually :)&lt;br&gt;
jasonbraganza: nabarun, that analogy does not quite fit in my head. i am just moving to a completely new space no, when i have to work&lt;br&gt;
sayan: s/rebase/pull changes/&lt;br&gt;
nabarun: jasonbraganza: think of it as you have just one workspace.&lt;br&gt;
jasonbraganza: aah, now i get it better :)&lt;br&gt;
sayan: nabarun: here wants to say you have one table for all technical things for example.&lt;br&gt;
nabarun: jasonbraganza: for example, I won&amp;rsquo;t keep copies of the same git workspace for different workstreams.&lt;br&gt;
jasonbraganza: nabarun, sayan thank you&lt;br&gt;
nabarun: jasonbraganza: jasonbraganza: more technical example, &lt;a href="https://share.riseup.net/#NN3bvnSif2gn5JC2i0GkgQ" target="_blank" rel="noreferrer"&gt;https://share.riseup.net/#NN3bvnSif2gn5JC2i0GkgQ&lt;/a&gt; I work on the same copy of kubernetes codebase for anything I am doing but stash and unstash things as I switch contexts.&lt;br&gt;
nabarun: jasonbraganza: I don&amp;rsquo;t keep more than one copy of the kubernetes codebase.&lt;br&gt;
sayan: jasonbraganza: my office team right now is spread toooooo thin. hope things change in future&lt;br&gt;
jasonbraganza: nabarun, my headspace says to use branches everytime. i need to understand stashes better&lt;br&gt;
nabarun: jasonbraganza: okay.&lt;br&gt;
jasonbraganza: nabarun, so you just stash things and stash things and stash things and then keep switching between them (for a single project?)&lt;br&gt;
nabarun: jasonbraganza: my mental model of differentiating them is like branches are completed pieces of work. stashes are incomplete state of my mind.&lt;br&gt;
jasonbraganza: nabarun, feels better like you describe.&lt;br&gt;
jasonbraganza: i should learn to do this.&lt;br&gt;
nabarun: jasonbraganza: I do both branches as well as stashes based on what my mind thinks of the situation.&lt;br&gt;
jasonbraganza: yea i’m sure, i’ll evolve to something like that mindset&lt;br&gt;
nabarun: yup. it will come with practice.&lt;br&gt;
sayan: my mental model is a bit simpler, create branch when you work on something new, and commits as necessary, stash if you think you need to work on some other branch for the time being&lt;br&gt;
jasonbraganza: sayan, what about saving daily/regular progress? i like having snapshots of progress. how do you tackle that?&lt;br&gt;
sayan: jasonbraganza: &lt;a href="https://github.com/sayanchowdhury/words.yudocaa.in/commits/master" target="_blank" rel="noreferrer"&gt;https://github.com/sayanchowdhury/words.yudocaa.in/commits/master&lt;/a&gt;&lt;br&gt;
sayan: this is the only place I do regular commits/daily progress&lt;br&gt;
jasonbraganza: ok&lt;br&gt;
sayan: other than this, I do commits as required.&lt;br&gt;
jasonbraganza: understood :)&lt;br&gt;
nabarun: saving == committing at the desired interval. :)&lt;br&gt;
jasonbraganza: nabarun, this is me :)&lt;br&gt;
nabarun: jasonbraganza: as in?&lt;br&gt;
jasonbraganza: saving == committing at the desired interval.&lt;br&gt;
nabarun: haha. that is me too.&lt;br&gt;
nabarun: my working branches are filled with &amp;ldquo;fixup! foo bar&amp;rdquo; commits.&lt;br&gt;
sayan: nabarun: okay I would not mention that to jasonbraganza today&lt;br&gt;
sayan: fixup commits are bit advanced&lt;br&gt;
sayan: :)&lt;br&gt;
nabarun: sayan: sorry!&lt;br&gt;
sayan: nabarun: no need to be sorry, just putting my thoughts&lt;br&gt;
sayan: when you have to arrange the commits, fixup commits are best IMO&lt;br&gt;
nabarun: figuratively speaking they are just some extra metadata. nothing special behind them.&lt;br&gt;
sayan: nabarun: if that for rebase?&lt;br&gt;
nabarun: eh?&lt;br&gt;
jasonbraganza: nabarun, metadata for whom? git? or github?&lt;br&gt;
nabarun: jasonbraganza: git.&lt;br&gt;
jasonbraganza: aah. nice :)&lt;br&gt;
sayan: Interesting, if I do autosquash will those &amp;ldquo;fixup!&amp;rdquo; work?&lt;br&gt;
sayan: nabarun: ^^&lt;br&gt;
sayan: git rebase &amp;ndash;autosquash&lt;br&gt;
nabarun: yes. it should.&lt;br&gt;
jasonbraganza: and the best part about asking both of you, is realising that ok, the funny/advanced parts of a workflow might differ from person to person, but the basics stay the same, relatively.&lt;br&gt;
sayan: I earlier thought you were talking about git commit &amp;ndash;fixup, but you were saying git commit -m &amp;ldquo;fixup! &amp;hellip; &amp;quot;&lt;br&gt;
sayan: nabarun: ^^&lt;br&gt;
jasonbraganza: kushal, hurrah!&lt;br&gt;
nabarun: sayan: both of what you specified are valid ways of working.&lt;br&gt;
nabarun: sayan: git-rebase just looks at the commit message and decides the course of action.&lt;br&gt;
nabarun: jasonbraganza: yessss! git is simple yet complex. xD&lt;br&gt;
sayan: jasonbraganza: nabarun gulped git book :)&lt;br&gt;
nabarun: NO!&lt;br&gt;
nabarun: I didn&amp;rsquo;t read a complete chapter of that book.&lt;br&gt;
jasonbraganza: nabarun, that was me. i still always have it open :) it teaches me the ‘how’. the why and the culture is why i come to you folk :)&lt;br&gt;
sayan: nabarun: but you read :)&lt;br&gt;
sayan: I just learnt by seeing :)&lt;br&gt;
sayan: I should read though, interpreted knowledge is not always good&lt;br&gt;
nabarun: sayan: I learnt by practising and a lot of &lt;code&gt;man git-subcommand:&lt;/code&gt;&lt;br&gt;
nabarun: jasonbraganza: nice nice.&lt;br&gt;
sayan: jasonbraganza: it&amp;rsquo;s a very good book&lt;br&gt;
sayan: nabarun: nice!&lt;br&gt;
jasonbraganza: extremely good book. very lucid&lt;/p&gt;</description></item></channel></rss>