Sindbad~EG File Manager

Current Path : /usr/local/src/clamav-1.0.9/docs/html/manual/Development/
Upload File :
Current File : //usr/local/src/clamav-1.0.9/docs/html/manual/Development/personal-forks.html

<!DOCTYPE HTML>
<html lang="en" class="clamav sidebar-visible" dir="ltr">
    <head>
        <!-- Book generated using mdBook -->
        <meta charset="UTF-8">
        <title>Working with Your Fork - ClamAV Documentation</title>


        <!-- Custom HTML head -->

        <meta name="description" content="An open source malware detection toolkit and antivirus engine.">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="theme-color" content="#ffffff">

        <link rel="shortcut icon" href="../../favicon.png">
        <link rel="stylesheet" href="../../css/variables.css">
        <link rel="stylesheet" href="../../css/general.css">
        <link rel="stylesheet" href="../../css/chrome.css">
        <link rel="stylesheet" href="../../css/print.css" media="print">

        <!-- Fonts -->
        <link rel="stylesheet" href="../../FontAwesome/css/font-awesome.css">
        <link rel="stylesheet" href="../../fonts/fonts.css">

        <!-- Highlight.js Stylesheets -->
        <link rel="stylesheet" id="highlight-css" href="../../highlight.css">
        <link rel="stylesheet" id="tomorrow-night-css" href="../../tomorrow-night.css">
        <link rel="stylesheet" id="ayu-highlight-css" href="../../ayu-highlight.css">

        <!-- Custom theme stylesheets -->

        <!-- MathJax -->
        <script async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

        <!-- Provide site root and default themes to javascript -->
        <script>
            const path_to_root = "../../";
            const default_light_theme = "clamav";
            const default_dark_theme = "clamav";
        </script>
        <!-- Start loading toc.js asap -->
        <script src="../../toc.js"></script>
    </head>
    <body>
    <div id="body-container">
        <!-- Work around some values being stored in localStorage wrapped in quotes -->
        <script>
            try {
                let theme = localStorage.getItem('mdbook-theme');
                let sidebar = localStorage.getItem('mdbook-sidebar');

                if (theme.startsWith('"') && theme.endsWith('"')) {
                    localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
                }

                if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
                    localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
                }
            } catch (e) { }
        </script>

        <!-- Set the theme before any content is loaded, prevents flash -->
        <script>
            const default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? default_dark_theme : default_light_theme;
            let theme;
            try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
            if (theme === null || theme === undefined) { theme = default_theme; }
            const html = document.documentElement;
            html.classList.remove('clamav')
            html.classList.add(theme);
            html.classList.add("js");
        </script>

        <input type="checkbox" id="sidebar-toggle-anchor" class="hidden">

        <!-- Hide / unhide sidebar before it is displayed -->
        <script>
            let sidebar = null;
            const sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
            if (document.body.clientWidth >= 1080) {
                try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
                sidebar = sidebar || 'visible';
            } else {
                sidebar = 'hidden';
            }
            sidebar_toggle.checked = sidebar === 'visible';
            html.classList.remove('sidebar-visible');
            html.classList.add("sidebar-" + sidebar);
        </script>

        <nav id="sidebar" class="sidebar" aria-label="Table of contents">
            <!-- populated by js -->
            <mdbook-sidebar-scrollbox class="sidebar-scrollbox"></mdbook-sidebar-scrollbox>
            <noscript>
                <iframe class="sidebar-iframe-outer" src="../../toc.html"></iframe>
            </noscript>
            <div id="sidebar-resize-handle" class="sidebar-resize-handle">
                <div class="sidebar-resize-indicator"></div>
            </div>
        </nav>

        <div id="page-wrapper" class="page-wrapper">

            <div class="page">
                <div id="menu-bar-hover-placeholder"></div>
                <div id="menu-bar" class="menu-bar sticky">
                    <div class="left-buttons">
                        <label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
                            <i class="fa fa-bars"></i>
                        </label>
                        <button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
                            <i class="fa fa-paint-brush"></i>
                        </button>
                        <ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
                            <li role="none"><button role="menuitem" class="theme" id="clamav">Dark</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="clamav_light">Light</button></li>
                        </ul>
                        <button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
                            <i class="fa fa-search"></i>
                        </button>
                    </div>

                    <h1 class="menu-title">ClamAV Documentation</h1>

                    <div class="right-buttons">
                        <a href="../../print.html" title="Print this book" aria-label="Print this book">
                            <i id="print-button" class="fa fa-print"></i>
                        </a>

                    </div>
                </div>

                <div id="search-wrapper" class="hidden">
                    <form id="searchbar-outer" class="searchbar-outer">
                        <input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
                    </form>
                    <div id="searchresults-outer" class="searchresults-outer hidden">
                        <div id="searchresults-header" class="searchresults-header"></div>
                        <ul id="searchresults">
                        </ul>
                    </div>
                </div>

                <!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
                <script>
                    document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
                    document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
                    Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
                        link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
                    });
                </script>

                <div id="content" class="content">
                    <main>
                        <h1 id="working-with-a-your-own-fork-of-the-clamav-repository"><a class="header" href="#working-with-a-your-own-fork-of-the-clamav-repository">Working with a Your Own Fork of the ClamAV repository</a></h1>
<p>A "fork" on GitHub is a personal playground. Though the word "fork" in the concept of open source traditionally referred to creating (and maintaining) a new variant of a project, forks on GitHub/GitLab/BitBucket/etc these days typically refer to a personal copy of the project where a user can test modifications to fix a bug or add a feature before contributing it back to the project in the form of a "pull request".</p>
<h3 id="create-and-maintain-a-personal-fork"><a class="header" href="#create-and-maintain-a-personal-fork">Create and Maintain a Personal Fork</a></h3>
<p>You may only have one for any project, but it is very easy to create:</p>
<p><img src="../../images/create-a-fork.png" alt="Create a Fork" /></p>
<p>You can rename it as needed so you won't confused a clone of your fork with that of the upstream <code>clamav</code> repository. Go to the "Settings" page and change the name to add your name in a suffix:</p>
<p><img src="../../images/change-fork-name.png" alt="Change Fork Name" /></p>
<p>You're free to add or delete branches in your fork as you see fit, but I would advise against adding your own commits to the existing branches. The existing branches, particularly the default branch<code>*</code> are a reference from which you can create your own branches for your work. Adding your own commits to the existing branches will break your ability to synchronize with the upstream <code>Cisco-Talos/clamav</code> repository, and without more advanced Git experience you won't be able to correct it.</p>
<blockquote>
<p><em>Tip</em>: If you've managed to screw up the commit history in your fork to the point where you don't know how to fix it, you can always delete your fork and create a new one.</p>
</blockquote>
<p>Your fork is a snapshot of the upstream <code>clamav</code> repository at the moment at which you created it. Left unmaintained, your fork's default branch will get left behind. Unlike BitBucket, GitHub will not sync branches for you automatically. If your branch is behind, it is simple to sync the branch on your fork using GitHub's GUI by pressing the "Fetch Upstream" button:</p>
<p><img src="../../images/fork-is-behind.png" alt="Sync and Merge" /></p>
<p>You can sync other branches too. Simply switch branches to the desired branch and press "Fetch Upstream" again.</p>
<blockquote>
<p><em>Disclaimer</em>: The ClamAV project has a history of changing default branches for development on each feature version. We've found that this causes more trouble than it is worth, and we intend to stop doing that after 0.104. Right now, the default branch is <code>dev/0.104</code>. After 0.104 is complete, it will be changed to <code>main</code> and we'll stop changing it. For more details, see the work flow changes in the section below.</p>
<p><em>Tip</em>: After we change the default branch for <code>Cisco-Talos/clamav</code> to <code>main</code>, you'll need to change your default branch too (it won't switch in your fork just because we changed the default in the upstream repo).</p>
</blockquote>
<h3 id="working-with-a-clone-of-your-fork-on-the-command-line"><a class="header" href="#working-with-a-clone-of-your-fork-on-the-command-line">Working with a Clone of your Fork on the Command Line</a></h3>
<p>If you don't already have an SSH key for your GitHub account, I recommend creating one. Navigate to your Account Settings and under SSH and GPG keys, click the "New SSH key" button. If you're unfamiliar with how to generate an SSH key, there's a nearby link "generating SSH keys" with additional instructions.</p>
<p>Next, clone your ClamAV <em>fork</em>. Use the "Code" button on the default page for your fork to copy the "SSH" URL. If you don't want to use an SSH key for GitHub authentication, use the HTTPS URL instead:</p>
<p><img src="../../images/clone-your-fork.png" alt="Clone your Fork" /></p>
<p>Now open up a terminal and type:</p>
<pre><code class="language-bash">git clone &lt;paste that Git URL&gt;
cd clamav-YourNameHere
</code></pre>
<p>Create a branch off of the default branch where you will work. If working on a GitHub Issue, or JIRA task<code>*</code>, the following branch name prefixes will help you and others identify the branch:</p>
<ul>
<li>For GitHub issues: <code>issue-####-short-description</code></li>
<li>For JIRA task: <code>CLAM-####-short-description</code></li>
</ul>
<blockquote>
<p><em>Note</em>: <code>*</code>The ClamAV JIRA task tracker is not accessible outside of the Cisco network.</p>
</blockquote>
<p>Create your working branch:</p>
<pre><code>git checkout -b issue-####-short-description
</code></pre>
<p>You're now ready to make edits to the source. Be sure your changes match our code format style. The easiest way is to install <code>clang-format</code> and enable "Format On Save" in your text editor.</p>
<p>When you have made your changes, run:</p>
<pre><code class="language-bash">git add -u
git commit
</code></pre>
<p>Leave a meaningful git commit message that has a high-level descriptive title, and a more technical message body describing why the change was needed what your commit does to resolve it.</p>
<p>Run this to upload your commit to your fork on GitHub:</p>
<pre><code class="language-bash">git push -u origin &lt;the_name_of_your_branch&gt;
</code></pre>
<p>The <code>-u origin</code> argument will enable tracking between your local branch and your remote branch. In the future you will only need to do <code>git push</code> and it will know where to push it.</p>
<h3 id="rebase-your-development-branch-with-the-upstream-main-branch-and-resolving-merge-conflicts"><a class="header" href="#rebase-your-development-branch-with-the-upstream-main-branch-and-resolving-merge-conflicts">Rebase your development branch with the upstream <code>main</code> branch and resolving merge conflicts</a></h3>
<p>If you don't already have it:</p>
<pre><code>git remote add upstream git@github.com:Cisco-Talos/clamav.git
</code></pre>
<p>Then run:</p>
<pre><code>git fetch upstream
git rebase upstream/main
</code></pre>
<p>If you have any merge conflicts, you'll now have the opportunity to fix them. After every conflict is resolved and you've saved the files in question, run <code>git add &lt;the resolved files&gt;</code> and then run <code>git rebase --continue</code>.</p>

                    </main>

                    <nav class="nav-wrapper" aria-label="Page navigation">
                        <!-- Mobile navigation buttons -->
                            <a rel="prev" href="../../manual/Development/clamav-git-work-flow.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
                                <i class="fa fa-angle-left"></i>
                            </a>

                            <a rel="next prefetch" href="../../manual/Development/testing-pull-requests.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
                                <i class="fa fa-angle-right"></i>
                            </a>

                        <div style="clear: both"></div>
                    </nav>
                </div>
            </div>

            <nav class="nav-wide-wrapper" aria-label="Page navigation">
                    <a rel="prev" href="../../manual/Development/clamav-git-work-flow.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
                        <i class="fa fa-angle-left"></i>
                    </a>

                    <a rel="next prefetch" href="../../manual/Development/testing-pull-requests.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
                        <i class="fa fa-angle-right"></i>
                    </a>
            </nav>

        </div>



        <script>
            window.playground_line_numbers = true;
        </script>

        <script>
            window.playground_copyable = true;
        </script>

        <script src="../../ace.js"></script>
        <script src="../../editor.js"></script>
        <script src="../../mode-rust.js"></script>
        <script src="../../theme-dawn.js"></script>
        <script src="../../theme-tomorrow_night.js"></script>

        <script src="../../elasticlunr.min.js"></script>
        <script src="../../mark.min.js"></script>
        <script src="../../searcher.js"></script>

        <script src="../../clipboard.min.js"></script>
        <script src="../../highlight.js"></script>
        <script src="../../book.js"></script>

        <!-- Custom JS scripts -->


    </div>
    </body>
</html>

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists