Java Reference
In-Depth Information
We've only scratched the very surface of Git: it's a really powerful and some-
times quite complicated tool. Whole topics are devoted just to Git (including
Pragmatic Version Control Using Git [Swi08] and Pragmatic Guide to Git [Swi10] ).
But hopefully this is enough to get you started.
Next Up
Git is a powerful tool, not just because it gives you a project-wide “undo
button,” but because it allows you to experiment with confidence . You don't
have to be afraid that you'll screw everything up. When you do screw every-
thing up, Git lets you “unscrew” it back to the point where it all worked. With
branches, you can even try a couple of different approaches in code. Not sure
if you should use an array or a hash? Not sure if the listener should be in a
separate class? You can use branches to try things out.
With that freedom in hand, you're ready for the final step.
git config --global user.email email
Set your email address
git config --global user.name "Name"
Set your user name
git init
Initialize a Git repo in the current
directory
git add files
Add files (or directories) to be tracked
by Git
git commit -a -m ' Commit message '
Commit changes ( -a all)
git log --oneline files
Show commit messages for one or
more files
git status
Show what files you've changed, files
you've created but Git doesn't know
about (untracked), and so on
git diff files
Show differences between versions
git checkout files
Discard local changes for files (use
with caution)
git checkout name
Switch to named branch
git branch
List all branches
git branch name
Switch to named branch
git remote add origin url
Add a remote repo as “origin”
git push -u origin master
Copy changes on the master branch
to the remote named “origin”
 
 
Search WWH ::




Custom Search