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
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 [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb