Howto:Start using git: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 6: Line 6:
To get started using git, you really just need to know a  handful of commands in the beginning:
To get started using git, you really just need to know a  handful of commands in the beginning:


* git init NAME - to create a completely new empty repository (will not be needed for FG, just for experiments/testing)
* '''git init''' NAME - to create a completely new empty repository (will not be needed for FG, just for experiments/testing)
* git clone URL - to create a copy of a git repository locally (that's what you have done already to get the fgdata repository)
* '''git clone''' URL - to create a copy of a git repository locally (that's what you have done already to get the fgdata repository)
* git status - to view the status of the current repository
* '''git status''' - to view the status of the current repository
* git diff - to view differences
* '''git diff''' - to view differences
* git pull - to pull (=download AND merge!) latest updates from the repository that was used for cloning (for updating the local master branch using the origin)
* '''git pull''' - to pull (=download AND merge!) latest updates from the repository that was used for cloning (for updating the local master branch using the origin)
* git pull --rebase - to pull and rebase your own changes on top of the pulled data
* '''git pull --rebase''' - to pull and rebase your own changes on top of the pulled data
* git branch - to show active branch and display list of other local branches
* '''git branch''' - to show active branch and display list of other local branches
* git branch BRANCHNAME - to create a new branch using BRANCHNAME (branch=working copy)
* '''git branch''' BRANCHNAME - to create a new branch using BRANCHNAME (branch=working copy)
* git checkout BRANCHNAME - to checkout a certain branch (i.e. switch to that branch, make it active)
* '''git checkout''' BRANCHNAME - to checkout a certain branch (i.e. switch to that branch, make it active)
* git add FILENAME - to specify which new or modified files shall be added to the next commit (wildcards supported)
* '''git add''' FILENAME - to specify which new or modified files shall be added to the next commit (wildcards supported)
* git commit -M "COMMENT" - commit all files that you previously added using "git add" and add a short comment about your work
* '''git commit -m''' "COMMENT" - commit all files that you previously added using "git add" and add a short comment about your work




Navigation menu