Hex Artifact Content
Not logged in

Artifact 90059388b2ab852657b079c24331503820b8877a:

File www/cmd_add.wiki part of check-in [9436bb75c3] - Updated the main page, added add... by kejoki on 2008-11-15 04:08:26.

0000: 3c 68 32 3e 61 64 64 3c 2f 68 32 3e 0a 0a 54 68  <h2>add</h2>..Th
0010: 65 20 6f 66 74 65 6e 20 75 73 65 64 20 3c 63 6f  e often used <co
0020: 64 65 3e 61 64 64 3c 2f 63 6f 64 65 3e 20 63 6f  de>add</code> co
0030: 6d 6d 61 6e 64 20 69 73 20 68 6f 77 20 79 6f 75  mmand is how you
0040: 20 74 65 6c 6c 20 3c 62 3e 66 6f 73 73 69 6c 3c   tell <b>fossil<
0050: 2f 62 3e 20 74 6f 0a 69 6e 63 6c 75 64 65 20 61  /b> to.include a
0060: 20 28 75 73 75 61 6c 6c 79 20 6e 65 77 29 20 66   (usually new) f
0070: 69 6c 65 20 69 6e 20 74 68 65 20 72 65 70 6f 73  ile in the repos
0080: 69 74 6f 72 79 2e 0a 0a 3c 62 3e 66 6f 73 73 69  itory...<b>fossi
0090: 6c 3c 2f 62 3e 20 69 73 20 64 65 73 69 67 6e 65  l</b> is designe
00a0: 64 20 74 6f 20 6d 61 6e 61 67 65 20 61 72 74 69  d to manage arti
00b0: 66 61 63 74 73 20 77 68 6f 73 65 20 72 6f 6c 65  facts whose role
00c0: 20 69 73 20 62 65 69 6e 67 0a 22 73 6f 75 72 63   is being."sourc
00d0: 65 22 20 66 6f 72 20 73 6f 6d 65 74 68 69 6e 67  e" for something
00e0: 2c 20 6d 6f 73 74 20 70 72 6f 62 61 62 6c 79 20  , most probably 
00f0: 73 6f 66 74 77 61 72 65 20 70 72 6f 67 72 61 6d  software program
0100: 20 63 6f 64 65 20 6f 72 20 6f 74 68 65 72 0a 74   code or other.t
0110: 65 78 74 2e 20 20 4f 6e 65 20 63 61 6e 20 69 6d  ext.  One can im
0120: 61 67 69 6e 65 20 61 6c 6c 20 6b 69 6e 64 73 20  agine all kinds 
0130: 6f 66 20 77 61 79 73 20 74 6f 20 6c 65 74 20 66  of ways to let f
0140: 6f 73 73 69 6c 20 6b 6e 6f 77 20 6a 75 73 74 20  ossil know just 
0150: 77 68 61 74 0a 63 6f 6e 73 74 69 74 75 74 65 73  what.constitutes
0160: 20 61 20 73 6f 75 72 63 65 3b 20 74 68 65 20 73   a source; the s
0170: 69 6d 70 6c 65 73 74 20 61 6e 64 20 6d 6f 73 74  implest and most
0180: 20 64 69 72 65 63 74 20 77 61 79 20 69 74 0a 3c   direct way it.<
0190: 69 3e 61 63 74 75 61 6c 6c 79 3c 2f 69 3e 20 66  i>actually</i> f
01a0: 69 6e 64 73 20 6f 75 74 20 69 73 20 77 68 65 6e  inds out is when
01b0: 20 79 6f 75 20 67 69 76 65 20 69 74 20 74 68 65   you give it the
01c0: 0a 3c 63 6f 64 65 3e 20 66 6f 73 73 69 6c 20 61  .<code> fossil a
01d0: 64 64 20 3c 69 3e 66 69 6c 65 3c 2f 69 3e 20 3c  dd <i>file</i> <
01e0: 2f 63 6f 64 65 3e 20 63 6f 6d 6d 61 6e 64 2e 0a  /code> command..
01f0: 0a 49 74 27 73 20 72 65 61 73 6f 6e 61 62 6c 65  .It's reasonable
0200: 20 74 6f 20 74 68 69 6e 6b 20 6f 66 0a 74 68 65   to think of.the
0210: 20 3c 61 20 68 72 65 66 3d 22 63 6d 64 5f 69 6d   <a href="cmd_im
0220: 70 6f 72 74 2e 77 69 6b 69 22 3e 3c 63 6f 64 65  port.wiki"><code
0230: 3e 69 6d 70 6f 72 74 3c 2f 63 6f 64 65 3e 3c 2f  >import</code></
0240: 61 3e 0a 61 6e 64 20 3c 61 20 68 72 65 66 3d 22  a>.and <a href="
0250: 63 6d 64 5f 63 6c 6f 6e 65 2e 77 69 6b 69 22 3e  cmd_clone.wiki">
0260: 3c 63 6f 64 65 3e 63 6c 6f 6e 65 3c 2f 63 6f 64  <code>clone</cod
0270: 65 3e 3c 2f 61 3e 0a 63 6f 6d 6d 61 6e 64 73 20  e></a>.commands 
0280: 61 73 20 76 65 72 79 20 68 69 67 68 2d 70 6f 77  as very high-pow
0290: 65 72 65 64 20 76 65 72 73 69 6f 6e 73 20 6f 66  ered versions of
02a0: 20 74 68 65 20 3c 63 6f 64 65 3e 61 64 64 3c 2f   the <code>add</
02b0: 63 6f 64 65 3e 0a 63 6f 6d 6d 61 6e 64 20 74 68  code>.command th
02c0: 61 74 20 61 72 65 20 63 6f 6d 62 69 6e 65 64 20  at are combined 
02d0: 77 69 74 68 20 73 79 73 74 65 6d 20 6c 65 76 65  with system leve
02e0: 6c 20 66 69 6c 65 20 6d 6f 76 65 6d 65 6e 74 20  l file movement 
02f0: 61 6e 64 0a 6e 65 74 77 6f 72 6b 69 6e 67 20 66  and.networking f
0300: 75 6e 63 74 69 6f 6e 73 2e 20 20 4e 6f 74 20 70  unctions.  Not p
0310: 61 72 74 69 63 75 6c 61 72 6c 79 20 61 63 63 75  articularly accu
0320: 72 61 74 65 2c 20 62 75 74 20 72 65 61 73 6f 6e  rate, but reason
0330: 61 62 6c 65 2e 0a 0a 54 79 70 69 6e 67 20 3c 63  able...Typing <c
0340: 6f 64 65 3e 66 6f 73 73 69 6c 20 61 64 64 20 6d  ode>fossil add m
0350: 79 66 69 6c 65 3c 2f 63 6f 64 65 3e 20 63 61 75  yfile</code> cau
0360: 73 65 73 20 66 6f 73 73 69 6c 20 74 6f 20 70 75  ses fossil to pu
0370: 74 0a 3c 69 3e 6d 79 66 69 6c 65 3c 2f 69 3e 20  t.<i>myfile</i> 
0380: 69 6e 74 6f 20 74 68 65 20 72 65 70 6f 73 69 74  into the reposit
0390: 6f 72 79 20 61 74 20 74 68 65 20 6e 65 78 74 0a  ory at the next.
03a0: 3c 63 6f 64 65 3e 63 6f 6d 6d 69 74 3c 2f 63 6f  <code>commit</co
03b0: 64 65 3e 26 23 38 32 31 32 3b 70 72 6f 76 69 64  de>&#8212;provid
03c0: 65 64 20 79 6f 75 20 69 73 73 75 65 20 69 74 20  ed you issue it 
03d0: 66 72 6f 6d 20 77 69 74 68 69 6e 20 74 68 65 20  from within the 
03e0: 73 6f 75 72 63 65 0a 74 72 65 65 2c 20 6f 66 20  source.tree, of 
03f0: 63 6f 75 72 73 65 2e 0a 0a 4e 6f 74 65 20 74 68  course...Note th
0400: 61 74 20 74 68 65 20 72 65 70 6f 73 69 74 6f 72  at the repositor
0410: 79 20 69 73 20 3c 75 3e 6e 6f 74 3c 2f 75 3e 20  y is <u>not</u> 
0420: 63 68 61 6e 67 65 64 20 62 79 20 74 68 65 20 3c  changed by the <
0430: 63 6f 64 65 3e 61 64 64 3c 2f 63 6f 64 65 3e 0a  code>add</code>.
0440: 63 6f 6d 6d 61 6e 64 2c 20 62 75 74 20 62 79 20  command, but by 
0450: 74 68 65 20 3c 63 6f 64 65 3e 63 6f 6d 6d 69 74  the <code>commit
0460: 3c 2f 63 6f 64 65 3e 20 63 6f 6d 6d 61 6e 64 2e  </code> command.
0470: 20 20 3c 63 6f 64 65 3e 61 64 64 3c 2f 63 6f 64    <code>add</cod
0480: 65 3e 0a 3c 69 3e 6d 79 66 69 6c 65 3c 2f 69 3e  e>.<i>myfile</i>
0490: 20 74 65 6c 6c 73 20 3c 62 3e 66 6f 73 73 69 6c   tells <b>fossil
04a0: 3c 2f 62 3e 20 74 6f 20 22 6d 61 72 6b 22 20 3c  </b> to "mark" <
04b0: 69 3e 6d 79 66 69 6c 65 3c 2f 69 3e 20 61 73 20  i>myfile</i> as 
04c0: 70 61 72 74 20 6f 66 0a 74 68 65 20 72 65 70 6f  part of.the repo
04d0: 73 69 74 6f 72 79 2e 20 20 4f 6e 6c 79 20 63 6f  sitory.  Only co
04e0: 6d 6d 61 6e 64 73 20 77 68 69 63 68 20 61 63 74  mmands which act
04f0: 75 61 6c 6c 79 20 6d 61 6e 69 70 75 6c 61 74 65  ually manipulate
0500: 20 74 68 65 20 63 6f 6e 74 65 6e 74 0a 6f 66 20   the content.of 
0510: 74 68 65 20 22 73 6f 75 72 63 65 22 20 61 72 74  the "source" art
0520: 69 66 61 63 74 73 20 63 61 6e 20 70 68 79 73 69  ifacts can physi
0530: 63 61 6c 6c 79 20 70 75 74 20 74 68 65 20 66 69  cally put the fi
0540: 6c 65 20 69 6e 74 6f 20 28 6f 72 20 72 65 6d 6f  le into (or remo
0550: 76 65 0a 69 74 20 66 72 6f 6d 29 20 74 68 65 20  ve.it from) the 
0560: 72 65 70 6f 73 69 74 6f 72 79 2e 0a 0a 4a 75 73  repository...Jus
0570: 74 20 74 6f 20 6b 65 65 70 20 74 68 69 6e 67 73  t to keep things
0580: 20 63 6f 6e 66 75 73 65 64 2c 20 74 68 65 72 65   confused, there
0590: 20 61 72 65 20 61 6c 73 6f 20 63 6f 6d 6d 61 6e   are also comman
05a0: 64 73 20 74 68 61 74 20 63 61 6e 0a 6d 61 6e 69  ds that can.mani
05b0: 70 75 6c 61 74 65 20 74 68 65 20 72 65 70 6f 73  pulate the repos
05c0: 69 74 6f 72 79 20 77 69 74 68 6f 75 74 20 61 66  itory without af
05d0: 66 65 63 74 69 6e 67 20 74 68 65 20 63 68 65 63  fecting the chec
05e0: 6b 65 64 2d 6f 75 74 20 73 6f 75 72 63 65 73 0a  ked-out sources.
05f0: 28 73 65 65 20 3c 61 20 68 72 65 66 3d 22 63 6d  (see <a href="cm
0600: 64 5f 70 75 6c 6c 2e 77 69 6b 69 22 3e 66 6f 73  d_pull.wiki">fos
0610: 73 69 6c 20 70 75 6c 6c 3c 2f 61 3e 2c 20 66 6f  sil pull</a>, fo
0620: 72 20 69 6e 73 74 61 6e 63 65 2e 29 0a 0a 53 65  r instance.)..Se
0630: 65 20 61 6c 73 6f 3a 20 3c 61 20 68 72 65 66 3d  e also: <a href=
0640: 22 63 6d 64 5f 72 6d 2e 77 69 6b 69 22 3e 66 6f  "cmd_rm.wiki">fo
0650: 73 73 69 6c 20 72 6d 3c 2f 61 3e 2c 0a 3c 61 20  ssil rm</a>,.<a 
0660: 68 72 65 66 3d 22 63 6d 64 5f 69 6d 70 6f 72 74  href="cmd_import
0670: 2e 77 69 6b 69 22 3e 66 6f 73 73 69 6c 20 69 6d  .wiki">fossil im
0680: 70 6f 72 74 3c 2f 61 3e 2c 0a 3c 61 20 68 72 65  port</a>,.<a hre
0690: 66 3d 22 63 6d 64 5f 63 6c 6f 6e 65 2e 77 69 6b  f="cmd_clone.wik
06a0: 69 22 3e 66 6f 73 73 69 6c 20 63 6c 6f 6e 65 3c  i">fossil clone<
06b0: 2f 61 3e 2c 0a 3c 61 20 68 72 65 66 3d 22 63 6d  /a>,.<a href="cm
06c0: 64 5f 63 6f 6d 6d 69 74 2e 77 69 6b 69 22 3e 66  d_commit.wiki">f
06d0: 6f 73 73 69 6c 20 63 6f 6d 6d 69 74 3c 2f 61 3e  ossil commit</a>
06e0: 2c 0a 3c 61 20 68 72 65 66 3d 22 63 6d 64 5f 70  ,.<a href="cmd_p
06f0: 75 6c 6c 2e 77 69 6b 69 22 3e 66 6f 73 73 69 6c  ull.wiki">fossil
0700: 20 70 75 6c 6c 3c 2f 61 3e 2c 0a 3c 61 20 68 72   pull</a>,.<a hr
0710: 65 66 3d 22 63 6d 64 5f 73 65 74 74 69 6e 67 73  ef="cmd_settings
0720: 2e 77 69 6b 69 22 3e 66 6f 73 73 69 6c 20 73 65  .wiki">fossil se
0730: 74 74 69 6e 67 3c 2f 61 3e 20 28 61 73 79 6e 63  tting</a> (async
0740: 29 2c 0a 3c 61 20 68 72 65 66 3d 22 72 65 66 65  ),.<a href="refe
0750: 72 65 6e 63 65 2e 77 69 6b 69 22 3e 52 65 66 65  rence.wiki">Refe
0760: 72 65 6e 63 65 3c 2f 61 3e 0a                    rence</a>.