Difference between revisions of "git"

Line 20: Line 20:
 
==Commit==
 
==Commit==
 
<pre> git commit -a -m "commit message"</pre>
 
<pre> git commit -a -m "commit message"</pre>
 +
 +
This will commit the changes to your local repository.
 +
 
make *sure* you check status first, this will add all new files and commit them to your local repository.
 
make *sure* you check status first, this will add all new files and commit them to your local repository.
  
Line 25: Line 28:
  
 
Yes, that means that you have to git add a file every time you modify it, even if the file is already being tracked.
 
Yes, that means that you have to git add a file every time you modify it, even if the file is already being tracked.
 +
 +
==Push==
 +
<pre>git push origin</pre>
 +
 +
will push all commited patches you have on your local repository to the shared one you checked out from

Revision as of 19:18, 20 June 2007

Checkout

git clone <repo> name

Checks out a copy of repo into the named directory

git clone nimbus.aboutus.com:/opt/git/aboutus aboutus-1.10.0

you'll want to edit .git/info/exclude and add at least LocalSettings.php, don't know how we can get these transmitted automatically

Status

git status

Diff

git diff

Update

git pull

Commit

 git commit -a -m "commit message"

This will commit the changes to your local repository.

make *sure* you check status first, this will add all new files and commit them to your local repository.

If you don't want to use -a (probably a good idea) then run git add for each file you want to update before you run git commit.

Yes, that means that you have to git add a file every time you modify it, even if the file is already being tracked.

Push

git push origin

will push all commited patches you have on your local repository to the shared one you checked out from



Retrieved from "http://aboutus.com/index.php?title=git&oldid=7599031"