<?xml version="1.0"?>
<ownershipDocument>

    <schemaVersion>X0508</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2025-12-10</periodOfReport>

    <issuer>
        <issuerCik>0001653482</issuerCik>
        <issuerName>Gitlab Inc.</issuerName>
        <issuerTradingSymbol>GTLB</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001886022</rptOwnerCik>
            <rptOwnerName>Sijbrandij Sytse</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>C/O GITLAB INC.</rptOwnerStreet1>
            <rptOwnerStreet2></rptOwnerStreet2>
            <rptOwnerCity>NOT APPLICABLE</rptOwnerCity>
            <rptOwnerState>DE</rptOwnerState>
            <rptOwnerZipCode></rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>true</isDirector>
            <isOfficer>false</isOfficer>
            <isTenPercentOwner>true</isTenPercentOwner>
            <isOther>false</isOther>
            <officerTitle></officerTitle>
            <otherText></otherText>
        </reportingOwnerRelationship>
    </reportingOwner>

    <aff10b5One>0</aff10b5One>

    <nonDerivativeTable></nonDerivativeTable>

    <derivativeTable>
        <derivativeTransaction>
            <securityTitle>
                <value>Class B Common Stock</value>
            </securityTitle>
            <conversionOrExercisePrice>
                <footnoteId id="F1"/>
            </conversionOrExercisePrice>
            <transactionDate>
                <value>2025-12-10</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>G</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
                <footnoteId id="F2"/>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>311721</value>
                </transactionShares>
                <transactionPricePerShare>
                    <footnoteId id="F1"/>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <exerciseDate>
                <footnoteId id="F1"/>
            </exerciseDate>
            <expirationDate>
                <footnoteId id="F1"/>
            </expirationDate>
            <underlyingSecurity>
                <underlyingSecurityTitle>
                    <value>Class A Common Stock</value>
                </underlyingSecurityTitle>
                <underlyingSecurityShares>
                    <value>311721</value>
                </underlyingSecurityShares>
            </underlyingSecurity>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>15413551</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>By Trust</value>
                    <footnoteId id="F3"/>
                </natureOfOwnership>
            </ownershipNature>
        </derivativeTransaction>
    </derivativeTable>

    <footnotes>
        <footnote id="F1">Each share of the Issuer's Class B common stock (the &quot;Class B Stock&quot;) is convertible into one share of the Issuer's Class A common stock at any time and will convert automatically upon certain transfers and upon the earlier of (i) ten years from the date of the Issuer's initial public offering (&quot;IPO&quot;), (ii) the death or disability of the Reporting Person, (iii) the first date following the completion of the IPO on which the number of shares of outstanding Class B Stock (including shares of Class B Stock subject to outstanding stock options) is less than 5% of the aggregate number of shares of the Issuer's common stock then outstanding and (iv) the date specified by a vote of the holders of two-thirds of the then outstanding shares of Class B Stock.</footnote>
        <footnote id="F2">The reported transaction represents a bona fide gift by the Trust, to a charitable foundation, which is exempt under Rule 16b-5.</footnote>
        <footnote id="F3">These securities are held by the Sytse Sijbrandij Revocable Trust dated February 21, 2019 (the &quot;Trust&quot;), of which the Reporting Person is the sole trustee.</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>/s/ Robin Schulman, Attorney-in-Fact for Sytse Sijbrandij</signatureName>
        <signatureDate>2025-12-12</signatureDate>
    </ownerSignature>
</ownershipDocument>
