git commands

Upload: sheng-yu

Post on 06-Jan-2016

4 views

Category:

Documents


0 download

DESCRIPTION

Simple Git Commands

TRANSCRIPT

Git Commandsgit init - initiates a new git repositorygit status - checks the status of the repositorygit add - adds a new file to the repository and begins to track it ('*.txt' -adds all files with .txt extension)git commit - commits the changes to the repository (-m, includes a message)git log - looks at the commits that were being madegit remote add - adds a remote repository you can push your local repository intogit push - tells Git where to put the commits (-u, sets parameters)git pull - pulls down the repository to check for changesgit diff - checks for the differences in changes for the repository (HEAD can be used to check for more recent commit, --staged to see which ones are on the staged area)git reset - unstages the files that were just stagedgit checkout -- can change back files to their last commitgit branch - makes a new copy of the file for editing purposes (-d to delete branches)git rm - removes filesgit merge - merges two branches (ALWAYS BE ON MASTER BRANCH! CHECK IT OUT FIRST!)