To see if Git is installed on your computer: $git
If you don't have git, to install it: http://git-scm.com/downloads
To find out which version of Git that you have: $git --version
"which" tells you where the command is located on the disk so it gives you the path to it. It will only work on executables. To find out where Git is installed: $which git
There's one file called .gitconfig in the home directory with global git settings. To setup username and email key to associate with your commits:
$git config --global user.name "Josephine March"
To make your Git color coded: $git config --global color.ui true
If you change your permissions, git will ignore it if you run this command:
$git config --global core.filemode
Telling git to use nano as your CL text editor. This is very helpful with merges.
$git config --global core.editor nano
To see all the configurations:
$git config --list
To add a single untracked file into the repository:
$git add {filename}
To add all untracked files into the repository:
$git add .
$git add --all
To show what changes have been made:
$git diff
To show what changes have been made in a single file:
$git diff {filename}
Adding a file is staging. If you want to undo a stage:
$git reset HEAD {filename}
If you make changes in a file that's in a git repository and you have not yet staged them, you can reverse the changes with this command:
$git checkout {filename}
Github.com, place to store git repositories
Saturday, February 06, 2016
Subscribe to:
Post Comments
Post a Comment
Note: Only a member of this blog may post a comment.