-
Notifications
You must be signed in to change notification settings - Fork 447
SourceCodeGit_Commands
This is an page with examples for much used commands for Git.
Writing this page I lean heavily on the commands used at Siteground.com and some on Confluence.
We're not trying to teach a user how to use Git, but instead if they're ever stuck they can come to the page and quickly look down the page for the command they're missing.
Note: Git is context sensitive. All commands by default operate on the current active branch if no specific branch is specified! Before copy&pasting a command please make sure you have the correct branch activated.
git clone https://github.com/BOINC/boinc boinc
With this command you make a complete copy of the remote BOINC repository from the server onto your computer into the newly created directory "boinc".
git fetch
With this command you get all the objects (commits, branches) from the remote repository that are not present in the local one but nothing get's merged.
git pull
With this command you get all the objects from the remote repository (git fetch) and merge changes from the remote branch into your currently active local branch (git merge).
git checkout client_release/7/7.8
With this command you create and activate a local copy of the remote client release branch.
git checkout --track -b boinc_7.8 origin/client_release/7/7.8
With this command you create and activate a local copy of the remote client release branch with a custom name. The local branch is also connected to the remote branch so that git pull still works.
git checkout boinc_7.8
With this command you can switch to your custom branch if you switched to a different branch in the meantime.
git checkout master
With this command you can switch to the Master branch if you switched to a different branch in the meantime.
git branch
Lists existing branches.
git branch -a
List existing branches, including the ones on the remote server.
git status
Shows you the status of files in the index versus the working directory.
git log
Shows a listing of commits on a branch including the corresponding details.
git log --since=01-12-1970 --pretty=format:"%s" --graph --grep="client:" --grep="MGR:" --grep="Mac:" --grep="Mac installer:" --grep="Mac uninstaller:" --grep="Manager:" --grep="client/lib:" --grep="LIB:" --grep="SCR:" --grep="WINBUILD:" --grep="locale:" --grep="CURL:" --grep="OpenSSL:" --grep="zlib:" --grep="Linux:" --grep="VBOX:" --grep="server:" > a_filename.txt
An example of a large search through all commits for specific key words.