checkout [branch name] (switch to branch)
branch [branch name] (create a new branch)
fetch [short name] (fetch branches and/or tags from one or more repositories)
config --list (list all settings - make sure they are correct)
config --global user.email email@example.com
config --global user.name "John Doe"
Setting up Git
Most images for the BeagleBone Black come with Git pre-installed.
Git for Windows can be downloaded from http://code.google.com/p/msysgit/. If you plan to use the same computer each time you work on your program, download and install the version that begins with Git. If you will be using multiple computers, you should download the portable version and extract it to a your USB flash drive (the same one you store your programs on).
DVCS stands for distributed version control system. It's a tool that many programmers use to track changes in their programs. Several DVCSs exist, the most popular being Git. When used in conjunction with an online service like GitHub or Bitbucket, it also allows programmers to collaborate on the same files at the same time as well as backup their program's file online.Installation on Windows
Setting up a Repositoryinit (initialized a repository)
remote add [short name] url
remote (see a list of current remotes)
Commiting & Pushing
add -u (stage all changed files)commit -m "Add a note about the commit here" (creates a snapshot of the project on the local machine)
push [short name] [branch]
pull [short name] [branch] (retrieve latest commits made online or by others)
Taggingtag (list tags)
tag [name of tag]
tag -a [name of tag] -m "Comment about tag"
push [short name] --tags
gitk (GUI to visualize history)
Other Useful Commands
reset --hard HEAD~1 (completely delete last commit)
push -f (use this following the above command to remove the last commit from the online repository too if it's already been pushed)
In the event your computer dies and you need to recover your code from your online repository, you can do so using the following procedure: