Git Commands
Git Commands
Git resources
Notes
Git commands
Tell Git
who you
are
Configure the
author name and
email address to
be used with your
commits.
strips some
characters (for
example trailing
periods) from
user.name.
Create a
new local
repository
Check out
a
repository
Add files
Commit
git init
Create a working
copy of a local
repository:
For a remote
server, use:
Commit changes
to head (but not
yet to the remote
repository):
git commit -a
git add *
Send changes to
the master branch
of your remote
repository:
Status
git status
Connect to
a remote
repository
If you haven't
connected your
local repository to
a remote server,
add the server to
be able to push to
it:
git remote -v
Branches
Create a new
branch and switch
to it:
git branch
Delete a branch
on your remote
repository:
Update
from the
remote
repository
git pull
To merge a
different branch
into your active
branch:
git diff
Preview changes,
before merging:
Tags
tagging to mark a
significant
changeset, such
as a release:
Undo local
changes
CommitId is the
leading
characters of the
changeset ID, up
to 10, but must be
unique. Get the ID
using:
git log
Changes already
added to the
index, as well as
new files, will be
kept.
Search
Instead, to drop
all your local
changes and
commits, fetch the
latest history from
the server and
point your local
master branch at
it, do this:
Search the
working directory
for foo():
Yes
No