Changes between Initial Version and Version 1 of SourceCodeGit/Commands


Ignore:
Timestamp:
Aug 15, 2017, 7:50:28 AM (7 years ago)
Author:
Ageless
Comment:

adding Commands page as an example of showing much used Git commands

Legend:

Unmodified
Added
Removed
Modified
  • SourceCodeGit/Commands

    v1 v1  
     1This is an page with examples for much used commands for Git.
     2
     3Writing this page I lean heavily on the commands used at [https://www.siteground.com/tutorials/git/commands.htm Siteground.com] and some on [https://confluence.atlassian.com/bitbucket/branching-a-repository-223217999.html Confluence].
     4
     5We'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.
     6
     7----
     8{{{
     9git clone https://github.com/BOINC/boinc boinc
     10}}}
     11With this command you make a complete copy of the remote BOINC repository from the server onto your computer.
     12
     13{{{
     14git fetch
     15}}}
     16With this command you get all the objects from the remote repository that are not present in the local one.
     17
     18{{{
     19git pull
     20}}}
     21With this command you get all the changed files from the remote repository and merge them with your local one.
     22
     23{{{
     24git branch boinc_7.8
     25}}}
     26With this command you make a branch called boinc_7.8 in your local repository.
     27
     28{{{
     29git branch --set-upstream-to=origin/client_release/7/7.8
     30}}}
     31It may happen at times that you've cloned the BOINC repository and that it then only remembers the path to the remote repository's Master branch, which makes it impossible for you to update the boinc_7.8 branch with. With the above command you can quickly set the boinc_7.8 branch to the right remote repository. Git on your system will remember both paths after this.
     32
     33{{{
     34git checkout boinc_7.8
     35}}}
     36With this command you can switch to the boinc_7.8 branch from the Master branch.
     37
     38{{{
     39git checkout master
     40}}}
     41With this command you can switch to the Master branch from the boinc_7.8 branch.
     42
     43{{{
     44git branch
     45}}}
     46Lists existing branches.
     47
     48{{{
     49git branch -a
     50}}}
     51List existing branches, including the ones on the remote server.
     52
     53{{{
     54git status
     55}}}
     56Shows you the status of files in the index versus the working directory.
     57
     58{{{
     59git log
     60}}}
     61Shows a listing of commits on a branch including the corresponding details.
     62
     63{{{
     64git 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
     65}}}
     66An example of a large search through all commits for specific key words.