Git
From PHASTA Wiki
Contents
Introduction
Git is a distributed revision control system (VCS), designed to work well with highly non-linear workflows. It was initially conceived to support development of the Linux kernel, and has since become the most widely-used VCS for software development.
This page is essentially a cheat-sheet for git commands frequently used by our group.
Basic Git
Basic information to get started with Git can be found at http://rogerdudler.github.io/git-guide/.
- Git repository
- Is a directory that contains files of the current branch and a hidden
.git
directory - Contains an Index in
.git
that acts as a staging area for all your branches - Contains a HEAD in
.git
that points to the last commit you made - Your PHASTA repository should always be at
~/git-phasta/phasta
- Create a new repository
-
git init
- Checkout a repository
-
git clone /path/to/repository
-
git clone username@remote-host:/path/to/repository
- Add files to be tracked in the git index
-
git add <filename1> <filename2> ...
-
git add *
-
git add -u
(all files updated since last commit)
- Commit changes to HEAD
-
git commit -m "my_username: my comments about this commit"
- Push changes to remote repo
-
git push origin master
(pushes themaster
branch to the original/main repo)
Deeper Shit (more advanced material)
Setting Up PHASTA
Modifying PHASTA
==