[cctbxbb] Git

Nicholas Sauter nksauter at lbl.gov
Tue Jan 12 12:55:06 PST 2016


Great! Thanks,
Nick

Nicholas K. Sauter, Ph. D.
Computer Staff Scientist, Molecular Biophysics and Integrated Bioimaging
Division
Lawrence Berkeley National Laboratory
1 Cyclotron Rd., Bldg. 33R0345
Berkeley, CA 94720
(510) 486-5713

On Tue, Jan 12, 2016 at 12:45 PM, Luc Bourhis <luc_j_bourhis at mac.com> wrote:

> > We discussed your "git add -p" suggestion in our group meeting just now,
> and nobody here could explain why the command would be "git add" rather
> than "git commit".  So if you want to commit all of your changes at once
> you would use "git commit", but not "git add"?  Or is "git add" mandatory
> anytime you want to commit any change and it is only the "-p" flag that is
> optional?
>
> git has the concept of the staging area which svn does not have:
>
> - git add some_file.py will add the whole file to the staging area
> - git add -p will let you select which chunks go into the staging area
>
> and you can mix and match those with different files at your heart
> content. When the staging area contains what you want in your commit, then
> you just do
>
> git commit -m ‘your commit message’
>
> and everything in the staging area will end up in that new commit.
>
> But sometimes, you just want to commit a single file and then you can do
> the shortcut:
>
> git commit -m ‘message’ your_file.py
>
> which is equivalent to
>
> git add your_file.py
>
> followed by
>
> git commit -m ‘message’
>
> I hope this answers your question.
>
> Luc
>
>
> _______________________________________________
> cctbxbb mailing list
> cctbxbb at phenix-online.org
> http://phenix-online.org/mailman/listinfo/cctbxbb
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://phenix-online.org/pipermail/cctbxbb/attachments/20160112/0917b655/attachment.htm>


More information about the cctbxbb mailing list