emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tim Cross <theophilusx@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: literate programming, development log -- ideas? (ominbus reply)
Date: Mon, 14 Jun 2021 09:13:41 +1000	[thread overview]
Message-ID: <874ke1z4gz.fsf@gmail.com> (raw)
In-Reply-To: <6271e100-9799-435a-992b-e657849c3302@www.fastmail.com>


"Samuel Banya" <sbanya@fastmail.com> writes:

> Hey Tim,
>
> Wow that's an awesome idea too aka to create local branches on each machine, and then switch over the master branch to pull them in.
>
> Do you have any video references for this kind of thing?
>
> I like videos first, and then documentation.
>
> It would really help me out since I'd love to try to figure this kind of thing out, since I am pretty close to just using rsync for my Git notes going forward,
> but needed that kind of convincing otherwise.
>

Sorry, no video links/references. There are lots out there, I just don't
watch them. I think one of the best ways to understand git is to just
use it at the command line and experiment. Git can appear daunting, but
it is actually fairly easy. It has a huge number of commands and
options, but 90% of the time, you really only need a very small handful.

The nice thing about learning a VCS is that you can clone a repository,
experiment as much as you like and when you make a mistake, try to use
git to undo it, but if all else fails, blow away your copy and clone and
try again.

Probably the biggest complaint I see about git (or almost any VCS) is
merge hell. However, this can be largely avoided with a few simple rules
and some discipline in your workflow. People often get into this type of
mess because they make lots of changes before committing them and
because they make changes on the master branch rather than a topic
branch.

I almost never make changes directly to the master branch. I will create
a new branch for even small changes and then merge it back into master
once the changes are complete. Sometimes, I forget and realise I've made
changes which should have been done in a branch. When this happens, I
use the 'stash' command to stash my changes, create a topic branch and
then apply the stash to that branch.

If a topic branch has existed for a while and you know the master branch
has diverged significantly since you made your topic branch, it can be
useful to rebase your topic branch against the current master branch.
This will effectively apply all the changes from master to your topic
branch *before* then applying your changes. It is like you have just
forked your topic branch from master. You may still get some conflicts
when re-applying your branch changes, but there will typically be less
and they will be easier to resolve. 

If your working on a project with lots of contributors, where master
changes quite quickly, you may want to do frequent pulls and either
merge or rebase into your topic branch. Merge conflict really only
becomes a pain when there are lots of changes to all apply at once. If
I'm working on a large project with lots of contributors, I might do a
pull and merge or rebase into my topic branch every day (maybe multiple
times per day). On a private repository, I will do this far less often
because I know what has changed and when it is a good idea to merge or
rebase my current topic branch.

Provided some discipline is applied, I find when it comes time to merge
my topic branch back into master, it is a straight forward merge with no
conflicts and changes in master remain clean. 

It is sometimes a good idea to poke around a bit in the .git directory
and get to understand what is in there and how it works. It is
surprisingly simple once you understand the structure. One of the things
I like about git is that it makes simple things simple and hard things
possible.

Sometimes, using some sort of sync software is the right solution. I
regularly use rsync for a number of tasks. However, I use git and remote
git services like gitlab or github for all of my projects and org notes.
Some people prefer Mercurial (hg) over git. I think it is a fine VCS as
well and often use it too. It has many of the same concepts and can be
used in a similar manner. For some people, it sits better with the way
they work/think than git. However, the core concepts are the same.  


  reply	other threads:[~2021-06-14  0:16 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-07 11:43 literate programming, development log -- ideas? Greg Minshall
2021-06-07 12:00 ` Juan Manuel Macías
2021-06-08 17:15   ` literate programming, development log -- ideas? (ominbus reply) Greg Minshall
2021-06-08 17:21     ` Samuel Banya
2021-06-09  8:59       ` Eric S Fraga
2021-06-09 22:21         ` Dr. Arne Babenhauserheide
2021-06-10 22:07           ` Samuel Wales
2021-06-11  0:13             ` Samuel Banya
2021-06-11 14:30               ` Juan Manuel Macías
2021-06-11 15:02                 ` Samuel Banya
2021-06-09 14:52       ` Maxim Nikulin
2021-06-10 13:28         ` Greg Minshall
2021-06-11 19:51       ` Christian Barthel
2021-06-13  0:46       ` Tim Cross
2021-06-13 15:48         ` Samuel Banya
2021-06-13 23:13           ` Tim Cross [this message]
2021-06-09  8:57     ` Eric S Fraga
2021-06-13  0:31       ` Tim Cross
2021-06-13  4:27         ` Greg Minshall
2021-06-13  7:29           ` Tim Cross
2021-06-14  6:14             ` Greg Minshall
2021-06-07 12:08 ` literate programming, development log -- ideas? Eric S Fraga
2021-06-13  0:24   ` Tim Cross
2021-06-13 15:44     ` Samuel Banya
2021-06-14 12:57       ` Greg Minshall
2021-06-07 13:53 ` Dr. Arne Babenhauserheide
2021-06-07 17:59   ` briangpowell
2021-06-07 23:17     ` Dr. Arne Babenhauserheide
2021-06-08  2:06       ` Samuel Banya
2021-06-08  3:23         ` Greg Minshall
2021-06-08  3:31           ` Samuel Banya
2021-06-08  6:15             ` Greg Minshall
2021-06-08 16:59     ` Greg Minshall
2021-06-07 19:19 ` Jack Kamm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874ke1z4gz.fsf@gmail.com \
    --to=theophilusx@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).