<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Louis Lagrange on Medium]]></title>
        <description><![CDATA[Stories by Louis Lagrange on Medium]]></description>
        <link>https://medium.com/@louis.lagrange?source=rss-4d5190d6f42a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*C2Kj1xxhZEUw_Aik.</url>
            <title>Stories by Louis Lagrange on Medium</title>
            <link>https://medium.com/@louis.lagrange?source=rss-4d5190d6f42a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 19:38:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@louis.lagrange/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Migrating from Firebase Dynamic Links: a practical guide]]></title>
            <link>https://medium.com/@louis.lagrange/migrating-from-firebase-dynamic-links-a-practical-guide-9905bbb8f04d?source=rss-4d5190d6f42a------2</link>
            <guid isPermaLink="false">https://medium.com/p/9905bbb8f04d</guid>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[dynamic-link]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[firebase]]></category>
            <dc:creator><![CDATA[Louis Lagrange]]></dc:creator>
            <pubDate>Thu, 20 Mar 2025 19:05:39 GMT</pubDate>
            <atom:updated>2025-03-20T19:05:39.383Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P3-GirTcYa2VQypy3Ygxjg.png" /><figcaption>Main steps</figcaption></figure><p>Firebase Dynamic Links is approaching its end-of-life on August 25th, 2025. This post will guide you through a pragmatic migration approach that works for both React Native and native apps.</p><h3>Scope and limitations</h3><h4>Product needs vs marketing needs</h4><p>Firebase Dynamic Links migrated using this approach will satisfy most product needs for deep linking within your application. The solution provides a reliable way to handle all standard deep linking scenarios such as sharing content, referrals, and navigating users to specific screens across mobile and web.</p><p>For links that require advanced ad tracking or attribution capabilities, this migration solution works best when complemented with full-fledged attribution platforms like Adjust or AppsFlyer. This creates a beneficial separation of concerns:</p><ul><li><strong>Product links</strong> remain under your complete control through your own infrastructure</li><li><strong>Marketing links</strong> can be managed by specialized third-party services</li></ul><p>This dual approach prevents vendor lock-in for your core product functionality. Since marketing campaigns are typically short-lived operations, using third-party links for these purposes poses minimal long-term risk even if those services change or deprecate in the future.</p><h4>Side benefits of the migration</h4><p>Moving away from Firebase Dynamic Links isn’t just about avoiding a service shutdown. You’ll also get:</p><ul><li><strong>Full control</strong> over your linking infrastructure</li><li><strong>Better security options</strong> like authenticated links if you implement them</li><li><strong>Custom analytics</strong> tailored to your needs</li><li><strong>Simpler privacy compliance</strong> by controlling how user data is handled</li></ul><h4>The deferred linking limitation</h4><p>It’s important to note that this migration approach has one significant limitation: it won’t support deferred dynamic links, although you may try to implement this yourself. Deferred deep linking refers to the process where:</p><ol><li>A user clicks on a link without having your app installed</li><li>They are redirected to the corresponding app store</li><li>The actual deferred deep linking feature: after installing the app, they are automatically redirected to the specific deep link content</li></ol><p>This “install-and-redirect” flow relies on specific proprietary mechanisms in Firebase Dynamic Links that cannot be easily replicated in a custom solution without significant complexity.</p><p>If deferred linking is crucial for your app, you might need to:</p><ul><li>Look into commercial alternatives</li><li>Add a manual step in the onboarding asking users if they came from a specific link</li><li>Implement custom tracking cookies or browser fingerprinting techniques (subject to platform limitations and privacy considerations)</li></ul><p>For most apps though, standard deep linking will cover the core functionality needed.</p><h3>The migration plan</h3><h4>Step 1: Create a proxy backend endpoint and collect links</h4><p>First, you’ll create a backend endpoint that intercepts link creation requests, forwards them to Firebase, and stores them in your database. This should be done quickly, ideally before the end of May 2025, to capture as many links as possible.</p><blockquote>With React Native, you can push this change via <a href="https://appzung.com/">AppZung</a> CodePush since it doesn’t require native code modifications.</blockquote><p><strong>Backend side</strong></p><p>Create a create-dynamic-link endpoint that:</p><ul><li>Validates input data (check if links are valid/safe with a domain allowlist)</li><li>Checks for duplicate links already in the database</li><li>Generates a random suffix if needed</li><li>Creates the link on Firebase using their API (while the service is still active)</li><li>Saves the dynamic link to your database</li><li>Handles errors properly</li></ul><p>Your input/output might look something like:</p><pre>input AndroidCreateDynamicLinkInput {<br>  minimumPackageVersionCode: Int<br>}<br><br>input IOSCreateDynamicLinkInput {<br>  minimumVersion: String<br>}<br><br>input OtherPlatformCreateDynamicLinkInput {<br>  fallbackUrl: String<br>}<br><br>input CreateDynamicLinkInput {<br>  android: AndroidCreateDynamicLinkInput<br>  deeplink: String!<br>  ios: IOSCreateDynamicLinkInput<br>  otherPlatform: OtherPlatformCreateDynamicLinkInput<br>  social: SocialCreateDynamicLinkInput<br>}<br><br>input SocialCreateDynamicLinkInput {<br>  description: String<br>  imageUrl: String<br>  title: String<br>}<br><br>type DynamicLink {<br>  androidMinimumPackageVersionCode: Int<br>  deeplink: String!<br>  id: ID!<br>  iosMinimumVersion: String<br>  link: String!<br>}<br><br>type CreateDynamicLinkOutput {<br>  dynamicLink: DynamicLink!<br>}</pre><p><strong>Client side</strong></p><p>When creating new links, instead of calling Firebase’s SDK (e.g., dynamicLinks().buildShortLink), call your new endpoint. You may also add a simple (or more sophisticated) client cache in order to prevent multiple calls for the same dynamic link parameters.</p><p>A simple example in Typescript would be:</p><pre>const generatedDynamicLinksDuringSessionCache = new Map&lt;string, string&gt;();<br><br>export const generateShortDynamicLink = async (<br>    { deeplinkPath, social, webUrl }: FirebaseDynamicLinkParams<br>) =&gt; {<br>    const cacheKey = JSON.stringify({ deeplinkPath, social, webUrl });<br>    const alreadyGeneratedDynamicLinkDuringSession =<br>        generatedDynamicLinksDuringSessionCache.get(cacheKey);<br>    if (alreadyGeneratedDynamicLinkDuringSession) {<br>        return alreadyGeneratedDynamicLinkDuringSession;<br>    }<br>    const { link } = await YourApi.createDynamicLink({<br>        deeplink: `https://${process.env.DYNAMIC_LINK_MAIN_CUSTOM_DOMAIN}/${deeplinkPath}`,<br>        otherPlatform: {<br>            fallbackUrl: webUrl,<br>        },<br>        social,<br>    });<br>    generatedDynamicLinksDuringSessionCache.set(cacheKey, link);<br>    return link;<br>};</pre><p><strong>Import existing links</strong></p><p>You’ll need to export your existing links from Firebase using Google Takeout:</p><ol><li>Go to <a href="https://takeout.google.com/">Google Takeout</a></li><li>Select only Firebase project data</li><li>Follow the export process</li></ol><p>Then import them into your database. Your import script should:</p><ul><li>Validate the data</li><li>Filter out archived links</li><li>Format social descriptions to fit your database constraints</li><li>Avoid duplicates</li></ul><p>Repeat this export/import monthly until Firebase’s sunset date to catch links generated by older app versions.</p><h4>Step 2: Replace Firebase Dynamic Links in your app</h4><p>Once most of your users have the first step modifications (if you use <a href="https://appzung.com/">AppZung</a> CodePush it should be quick!), it’s time to completely remove the Firebase Dynamic Links SDK and replace it with your implementation.</p><blockquote>This step should be done ideally before the end of June 2025 so that most of your user base has the updated native code when Firebase Dynamic Links is stopped.</blockquote><p><strong>Backend side</strong></p><p>Create a consume-dynamic-link endpoint that:</p><ul><li>Retrieves link data by suffix</li><li>Optionally tracks usage</li><li>Handles errors for invalid suffixes</li></ul><pre>input ConsumeDynamicLinkInput {<br>  suffix: String!<br>}<br><br>type DynamicLink {<br>  androidMinimumPackageVersionCode: Int<br>  deeplink: String!<br>  id: ID!<br>  iosMinimumVersion: String<br>  link: String!<br>}<br><br>type ConsumeDynamicLinkOutput {<br>  dynamicLink: DynamicLink!<br>}</pre><p><strong>Client side</strong></p><p>These changes will ensure that when a user who already has the app clicks on a dynamic link, it opens the link gracefully.</p><ol><li>Make sure Android’s intent filter is auto-verified:</li></ol><pre>&lt;intent-filter android:autoVerify=&quot;true&quot;&gt;<br>    &lt;action android:name=&quot;android.intent.action.VIEW&quot;/&gt;<br>    &lt;category android:name=&quot;android.intent.category.DEFAULT&quot;/&gt;<br>    &lt;category android:name=&quot;android.intent.category.BROWSABLE&quot;/&gt;<br>    &lt;data android:host=&quot;@string/firebase_dynamic_link_main_custom_domain&quot; android:scheme=&quot;https&quot;/&gt;<br>&lt;/intent-filter&gt;</pre><p>2. Ensure your iOS AppDelegate handles universal links by implementing continueUserActivity:</p><pre>- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity<br> restorationHandler:(nonnull void (^)(NSArray&lt;id&lt;UIUserActivityRestoring&gt;&gt; * _Nullable))restorationHandler<br>{<br>  // example for React Native<br>  return [RCTLinkingManager application:application continueUserActivity:userActivity restorationHandler:restorationHandler];<br>}</pre><p>3. Remove Firebase Dynamic Links SDK</p><p>4. Where you used to listen for the Firebase Dynamic Links, adapt it so that it listens for deeplinks. Then check if this is a dynamic link. If this is the case: parse it and eventually call your backend if it’s a short link.</p><p>For React Native:</p><ul><li>Remove calling @react-native-firebase/dynamic-links in your linking config&#39;s getInitialURL/subscribe</li><li>Instead, check if the deeplink returned by React Native uses the dynamic link domain</li><li>If so, call the below getDynamicLinkFromURL and handle the dynamic link like before</li></ul><pre>import queryString from &#39;query-string&#39;;<br>import { Platform } from &#39;react-native&#39;;<br>import { firebaseDynamicLinkMainCustomDomainPrefix } from &#39;./linkingPrefixes&#39;;<br><br>const dynamicLinkCacheDuringSession = new Map&lt;string, DynamicLink&gt;();<br><br>export const getDynamicLinkFromUrl = async (url: string): Promise&lt;DynamicLink | undefined&gt; =&gt; {<br>  if (!url.startsWith(firebaseDynamicLinkMainCustomDomainPrefix)) {<br>    return;<br>  }<br><br>  const alreadyKnownDynamicLinkDuringSession = dynamicLinkCacheDuringSession.get(url);<br>  if (alreadyKnownDynamicLinkDuringSession) {<br>    return alreadyKnownDynamicLinkDuringSession;<br>  }<br><br>  const { query, url: parsedUrl } = queryString.parseUrl(url);<br>  if (query.link) {<br>    // handle long dynamic links<br>    const firebaseDynamicLink = {<br>      url: query.link,<br>      minimumAppVersion:<br>        (Platform.OS === &#39;android&#39;<br>          ? query.amv != null<br>            ? parseInt(query.amv, 10)<br>            : null<br>          : query.imv) || null,<br>      utmParameters: {}, // FUTURE implement this if needed<br>    };<br>    dynamicLinkCacheDuringSession.set(url, firebaseDynamicLink);<br>    return firebaseDynamicLink;<br>  }<br><br>  const suffix = parsedUrl.replace(firebaseDynamicLinkMainCustomDomainPrefix + &#39;/&#39;, &#39;&#39;);<br>  const isAlreadyADeeplink = suffix.includes(&#39;/&#39;);<br>  if (isAlreadyADeeplink) {<br>    return {<br>      url,<br>      minimumAppVersion: null,<br>      utmParameters: {}, // FUTURE implement this if needed<br>    };<br>  }<br><br>  const response = await Api.consumeDynamicLink({<br>      suffix,<br>      platform: Platform.OS, // optional, for analytics<br>    })<br>    .catch((error) =&gt; {<br>      handleError(error);<br>      return null;<br>    });<br><br>  const dynamicLink = response?.dynamicLink;<br>  if (!dynamicLink) {<br>    return;<br>  }<br><br>  const firebaseDynamicLink = {<br>    url: dynamicLink.deeplink,<br>    minimumAppVersion:<br>      (Platform.OS === &#39;android&#39;<br>        ? dynamicLink.androidMinimumPackageVersionCode<br>        : dynamicLink.iosMinimumVersion) || null,<br>    utmParameters: {}, // FUTURE implement this if needed<br>  };<br>  dynamicLinkCacheDuringSession.set(url, firebaseDynamicLink);<br>  return firebaseDynamicLink;<br>};</pre><h4>Step 3: Set up web redirects</h4><p>For users without the app installed or those on desktop, you’ll need web redirects.</p><blockquote>This step is less urgent and can be done much closer to the sunset date.</blockquote><p>The basic idea is to use your Firebase Dynamic Links domain as a website or server. You can use a simple static website or serverless functions to detect the platform, call your consume-dynamic-link endpoint, and redirect users accordingly. Using a simple static website will be free, but it has some limitations: no dynamic social meta tags, and the code to detect the platform might take a while to load.</p><blockquote>I haven’t actually implemented this step for my clients yet as it’s not an immediate priority, but I’ll update this article once I have a concrete implementation to share.</blockquote><h3>AppCenter CodePush is also going away</h3><p>Since we’re talking about service migrations, it’s worth mentioning that Microsoft’s AppCenter CodePush is being retired in March 2025. If you’re a React Native developer dealing with both migrations, <a href="https://appzung.com/">AppZung</a> CodePush offers a drop-in replacement with:</p><ul><li>One-command migration (until March 31st as AppCenter will be down afterward)</li><li>Feature parity</li><li>EU hosting with worldwide CDN</li><li>New privacy, security and delivery features</li><li>No vendor lock-in as our maintained RN module is compatible with the open-source code-push-server</li><li>Happy customers!</li></ul><p>I personally don’t believe it’s necessary, but if there is enough user demand, we might add Dynamic Links to AppZung, so contact us if this is the case :)</p><h3>Conclusion</h3><p>Migrating from Firebase Dynamic Links might seem like a pain, but with this step-by-step approach, you can ensure a smooth transition. By taking control of your deep linking infrastructure now, you’ll be prepared for the actual shutdown and gain more flexibility in your implementation.</p><p>If you need help migrating, give me a ping at <a href="/service/mailto:lagrange.louis+consulting@gmail.com">lagrange.louis+consulting@gmail.com</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9905bbb8f04d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setup Firebase on iOS/Android with multiple environments]]></title>
            <link>https://medium.com/bam-tech/setup-firebase-on-ios-android-with-multiple-environments-ad4e7ef35607?source=rss-4d5190d6f42a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad4e7ef35607</guid>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Louis Lagrange]]></dc:creator>
            <pubDate>Thu, 12 Oct 2017 13:36:01 GMT</pubDate>
            <atom:updated>2017-10-13T09:34:30.815Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Bk0CLZDndItqL0oC.jpg" /></figure><p>It’s pretty <a href="https://blog.callstack.io/react-native-firebase-and-you-a07ae507910">straightforward</a> to install Firebase when you have only one environment. But what if you have multiple environments, such as dev, staging and production? Here’s a step-by-step guide.</p><h3>Android</h3><p>On Android, Firebase groups the different configurations in one file.</p><ol><li>Go to the <a href="https://console.firebase.google.com/">Firebase console</a></li><li>Select your project</li><li>Click “Add an application”, choose Android</li><li>Fill in the form (giving a name like Staging), click save, and close the window</li><li>Repeat steps 3 to 4 for all your environments</li><li>Download the google-services.json file<br>1. Select one of the Android applications<br>2. Click on “google-services.json”</li><li>Put google-services.json in your app folder (android/app in <a href="https://www.bam.tech/react-native">React-Native</a>)</li><li>You might want to add google-services.json in your .gitignore</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L7ACRaBSr_akuwGG.png" /><figcaption>Firebase console</figcaption></figure><h3>iOS</h3><p>On iOS, there is one Firebase configuration file per environment.</p><ol><li>Go to the <a href="https://console.firebase.google.com/">Firebase console</a></li><li>Select your project</li><li>Click “Add an application”, choose iOS</li><li>Fill in the form (giving a name like Staging), click save</li><li>Download the configuration file GoogleService-Info.plist and rename it like GoogleService-Info.{APP_IDENTIFIER}.plist<br>Example: for tech.bam.myApp.staging, this is GoogleService-Info.tech.bam.myApp.staging.plist</li><li>Repeat steps 3 to 5 for all your environments</li><li>Put your configuration files in the root of your iOS app folder (ios in <a href="https://www.bam.tech/react-native">React-Native</a>)</li><li>Make sure that your app identifier is injected in your .pbxproj. For example, if you’re using Fastlane, add a update_app_identifier step like:</li></ol><pre>update_app_identifier(<br>  xcodeproj: xcodeproj_full_path,<br>  plist_path: plist_full_path,<br>  app_identifier: ENV[&#39;APP_IDENTIFIER&#39;]<br>) </pre><p>9. In XCode, in Build phases, add a Select GoogleService-Info.plist build step before the Copy Bundle Resources step that contains:</p><pre>cp &quot;GoogleService-Info.&quot;$PRODUCT_BUNDLE_IDENTIFIER&quot;.plist&quot; &quot;GoogleService-Info.plist&quot;</pre><p>10. In XCode, in Build phases, add a Clean GoogleService-Info.plist build step after the Copy Bundle Resources step that contains:</p><pre>rm &quot;GoogleService-Info.plist&quot;</pre><p>11. Make sure that the GoogleService-Info.plist is listed in the resources of the Copy Bundle Resources step</p><p>12. You might want to add GoogleService-Info.*.plist in your .gitignore</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*owbfbmkqeioJr6VccdQinA.png" /><figcaption>XCode</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad4e7ef35607" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bam-tech/setup-firebase-on-ios-android-with-multiple-environments-ad4e7ef35607">Setup Firebase on iOS/Android with multiple environments</a> was originally published in <a href="https://medium.com/bam-tech">BAM Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Boost compilation time of your React Native or Android app with the latest build-tools]]></title>
            <link>https://medium.com/bam-tech/boost-compilation-time-of-your-react-native-or-android-app-with-the-latest-build-tools-a3d5d398ed33?source=rss-4d5190d6f42a------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3d5d398ed33</guid>
            <category><![CDATA[gradle]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Louis Lagrange]]></dc:creator>
            <pubDate>Fri, 05 May 2017 14:05:37 GMT</pubDate>
            <atom:updated>2017-10-13T08:07:29.013Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gLtik-lDErciInNWuRx3SA.jpeg" /></figure><p>With the release of Gradle 3 and the great performance boost it comes with, it’s very tempting to update like so:</p><p>In your root build.gradle, update the Gradle plugin so that it uses Gradle 3+:</p><pre>...<br>dependencies {<br>    classpath &#39;com.android.tools.build:gradle:2.3.0&#39;<br>...</pre><p>Then, in your app/build.gradle, update the build tools to the latest (25), because it&#39;s mandatory to support Gradle 3+:</p><pre>...<br>android {<br>    compileSdkVersion 23<br>    buildToolsVersion &#39;25.0.2&#39;<br>...</pre><p>Optionaly, if you have set distributionUrl in your gradle/wrapper/gradle-wrapper.properties file, you may want to replace it with:</p><pre>distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip</pre><p>Sadly, you’ll very much likely encounter this sort of error: The SDK Build Tools revision (23.0.1) is too low for project &#39;:react-native-vector-icons&#39;. Minimum required is 25.0.0. That&#39;s because one of your dependency (here, react-native-vector-icons) uses an old build tools version.</p><p>The process of updating the dependency (make a PR, be reviewed, be merged, and be published) can take a long time. Fortunately, you can overwrite the build tools version of your dependencies. To do so, copy and paste in your root build.gradle:</p><pre>ext {<br>    compileSdkVersion = 23<br>    buildToolsVersion = &#39;25.0.2&#39;<br>}</pre><pre>subprojects { subproject -&gt;<br>    afterEvaluate{<br>        if((subproject.plugins.hasPlugin(&#39;android&#39;) || subproject.plugins.hasPlugin(&#39;android-library&#39;))) {<br>            android {<br>                compileSdkVersion rootProject.ext.compileSdkVersion<br>                buildToolsVersion rootProject.ext.buildToolsVersion<br>            }<br>        }<br>    }<br>}</pre><p>And in your app/build.gradle, replace:</p><pre>...<br>android {<br>    compileSdkVersion rootProject.ext.compileSdkVersion<br>    buildToolsVersion rootProject.ext.buildToolsVersion<br>...</pre><p>Congratulations, you can now enjoy Gradle 3 build against the latest version of Android build-tools, thus boosting your compilation time. For example, in one of our <a href="http://www.bam.tech/react-native">React Native</a> application, it now takes only 10 seconds when no changes were made!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3d5d398ed33" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bam-tech/boost-compilation-time-of-your-react-native-or-android-app-with-the-latest-build-tools-a3d5d398ed33">Boost compilation time of your React Native or Android app with the latest build-tools</a> was originally published in <a href="https://medium.com/bam-tech">BAM Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Remove sensitive information from your Git repository]]></title>
            <link>https://medium.com/bam-tech/remove-sensitive-information-from-your-git-repository-10cb421f1b84?source=rss-4d5190d6f42a------2</link>
            <guid isPermaLink="false">https://medium.com/p/10cb421f1b84</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Louis Lagrange]]></dc:creator>
            <pubDate>Fri, 05 May 2017 13:54:08 GMT</pubDate>
            <atom:updated>2017-05-05T14:12:22.350Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zkHNghy7SAMKZemF0uhtCA.jpeg" /><figcaption><em>Security</em> is like a <em>chain</em>, as strong as the weakest link</figcaption></figure><p><strong>DISCLAIMER</strong>: This will rewrite your Git history and you won’t be able to go back in time if you don’t make a backup.</p><p>You have removed secret variables from your repo, but they obviously still show up in your Git history. There are several ways to get rid of them completely, and here’s the quickest:</p><ol><li>Make sure you have Java installed</li><li>Install <a href="https://rtyley.github.io/bfg-repo-cleaner/">BFG</a><br>On macOS: brew install bfg</li><li>Clone your repo in its entirety (every refs) inside a bare repo<br>git clone --mirror url/to/your/repo.git</li><li>Create a file with a new line for each string you want to remove (each string will be rewritten as ***REMOVED*** by default)<br>echo &quot;my_secret_API_key&quot; &gt;&gt; secret.txt<br>echo &quot;glob:SECRET_*&quot; &gt;&gt; secret.txt (search by glob pattern)<br>echo &quot;regex:password=\w+==&gt;password=&quot; &gt;&gt; secret.txt (search by regex pattern and change default rewritten text)</li><li>Remove the strings in your repo history<br>bfg --replace-text secret.txt repo.git</li><li>cd repo.git</li><li>Now is the time to verify in your history that everything’s fine</li><li>Clean your repo from dirty data<br>git reflog expire --expire=now --all &amp;&amp; git gc --prune=now --aggressive</li><li>Push your changes (forcing is not necessary because you updated every refs)<br>git push</li><li>Notify your coworkers that they have to clean their branches<br>git fetch origin/branch<br>git checkout -B branch origin/branch</li></ol><p>Note that if your repo is public, the Git history might have been cloned somewhere in the world, so your sensitive are already compromised. In that case, beware of a “Streisand” effect…</p><p>In any case, it’s best to regenerate your existing passwords, because they may have leaked.</p><p>In the future, try not to commit sensitive information in the first place ;) Here’s some tips:</p><ul><li>Use git diff --cached to verify the content that you&#39;re going to commit</li><li>Put sensitive information in *.secret files that are ignored in your .gitignore</li></ul><p>I narrowed this article to removing sensitive information from files, but you can do much more with BFG, including removing secret files entirely. Check out all the <a href="https://rtyley.github.io/bfg-repo-cleaner/#examples">BFG features</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=10cb421f1b84" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bam-tech/remove-sensitive-information-from-your-git-repository-10cb421f1b84">Remove sensitive information from your Git repository</a> was originally published in <a href="https://medium.com/bam-tech">BAM Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>