<?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 Tarik Yasar on Medium]]></title>
        <description><![CDATA[Stories by Tarik Yasar on Medium]]></description>
        <link>https://medium.com/@tyasar?source=rss-b1d9e5e559a4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*qx_KEDj9aeCXoXv8</url>
            <title>Stories by Tarik Yasar on Medium</title>
            <link>https://medium.com/@tyasar?source=rss-b1d9e5e559a4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 09:05:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tyasar/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[Jetpack Compose Bottom Sheet Management]]></title>
            <link>https://blog.simprasuite.com/jetpack-compose-bottom-sheet-management-e87ec765e5c0?source=rss-b1d9e5e559a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/e87ec765e5c0</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <dc:creator><![CDATA[Tarik Yasar]]></dc:creator>
            <pubDate>Wed, 24 Jan 2024 12:26:59 GMT</pubDate>
            <atom:updated>2024-01-24T12:28:05.730Z</atom:updated>
            <content:encoded><![CDATA[<p>Getting out of bottom sheet management hell…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HplcJ3oQNtzhnZWeCrkAjQ.jpeg" /></figure><p>Recently, we have been dealing with a variety of bottom sheets in our projects. If you have used ModalBottomSheetLayout, you know it requires some work. You need a ModalBottomSheetState and also need to add the bottom sheet to the needed screen. These may not look like much of a trouble, but it grows fast if you need to implement more than one bottom sheet.</p><p>This is where Rafael Costa’s awesome navigation library, <a href="https://github.com/raamcosta/compose-destinations">Compose Destinations</a>, shines. If you’ve ever struggled with Jetpack Compose’s navigation system, you’ve probably already heard about this library. In case you are using it, you should definitely try its bottom sheet management implementation.<a href="https://composedestinations.rafaelcosta.xyz/styles-and-animations?_highlight=bottom&amp;_highlight=sheet#animations--bottom-sheet-setup"> Rafael has explained it thoroughly</a>, but I will walk you through it step by step.</p><p>After this implementation, Compose Destinations will be managing all of the hassle of bottom sheets.</p><blockquote>If you don’t want to follow here, I created a <a href="https://github.com/tarikyasar/compose-destinations-bottom-sheet-sample">Github repository</a> which I implemented the logic, including returning results from bottom sheet to the main screen.</blockquote><h4>1. Implementing the basic logic</h4><p>If you didn’t implemented the library, you can follow the <a href="https://github.com/raamcosta/compose-destinations">tutorial here</a>. Only difference, you replace the dependency as below.</p><pre>implementation(&quot;io.github.raamcosta.compose-destinations:core:1.9.60&quot;)<br>// replace above with below<br>implementation(&quot;io.github.raamcosta.compose-destinations:animations-core:1.9.60&quot;)</pre><p>Once done with dependencies, we wrap your DestinationsNavHost composable with ModalBottomSheetLayout. We will be providing a navController and a bottomSheetNavigator. We can also give a certain shape to your bottom sheet.</p><pre>val navController = rememberNavController()<br>val bottomSheetNavigator = rememberBottomSheetNavigator()<br>navController.navigatorProvider += bottomSheetNavigator<br><br>ComposedestinationsTheme {<br>  ModalBottomSheetLayout(<br>    bottomSheetNavigator = bottomSheetNavigator,<br>    sheetShape = RoundedCornerShape(topStart = 12.dp, topEnd = 12.dp)<br>  ) {<br>    DestinationsNavHost(<br>      navController = navController,<br>      navGraph = NavGraphs.root,<br>      engine = rememberAnimatedNavHostEngine()<br>    )<br>}</pre><p>Suppose we have a screen with a button that opens the bottom sheet.</p><pre>@Destination<br>@Composable<br>fun SomeScreen(<br>  navigator: DestinationsNavigator<br>) {<br>    Column(<br>        modifier = Modifier.fillMaxSize(),<br>        horizontalAlignment = Alignment.CenterHorizontally,<br>        verticalArrangement = Arrangement.Center<br>    ) {<br>        Button(onClick = {<br>            navigator.navigate(<br>              SampleBottomSheetDestination // This destination object will be generated by Compose Destinations library<br>            )<br>        }) {<br>            Text(text = &quot;Open Bottom Sheet&quot;)<br>        }<br>    }<br>}</pre><p>Then we create a composable which takes <strong>@Destination</strong> annotation with the style of DestinationStyleBottomSheet. And add other composables just like we create a screen.</p><pre>@Destination(style = DestinationStyleBottomSheet::class)<br>@Composable<br>fun SampleBottomSheet() {<br>    Column(<br>        modifier = Modifier.fillMaxWidth(),<br>        horizontalAlignment = Alignment.CenterHorizontally<br>    ) {<br>        Spacer(modifier = Modifier.height(24.dp))<br><br>        Text(<br>            text = &quot;Bottom Sheet Title&quot;,<br>            fontSize = 24.sp,<br>            fontWeight = FontWeight.Bold<br>        )<br><br>        Spacer(modifier = Modifier.height(16.dp))<br><br>        Text(<br>            text = &quot;Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.&quot;,<br>            textAlign = TextAlign.Center<br>        )<br><br>        Image(<br>            imageVector = Icons.Default.AccountBox,<br>            contentDescription = &quot;&quot;,<br>            modifier = Modifier.size(160.dp)<br>        )<br><br>        Button(<br>            onClick = { /*TODO*/ },<br>            modifier = Modifier.padding(horizontal = 12.dp, vertical = 18.dp)<br>        ) {<br>            Text(text = &quot;Continue&quot;, fontSize = 24.sp)<br>        }<br><br>        Spacer(modifier = Modifier.height(24.dp))<br>    }<br>}</pre><p>Result of these codes will be like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*uxWMJerJsV3OQSsjaBflUw.gif" /></figure><p>By using Compose Destinations, we get to remove a lot of, in my humble opinion, unnecessary logic from our code. And it works like a charm. If that is enough for you that’s great. But we can take a little further by passing through a parameter to our bottom sheet.</p><h4>2. Navigating to bottom sheet with a parameter</h4><p>It’s just a matter of adding a parameter to the bottom sheet composable. Note that if you are adding a custom data class, it should be serializable.</p><pre>@Destination(style = DestinationStyleBottomSheet::class)<br>@Composable<br>fun SampleBottomSheet(<br>  bottomSheetParameter: String<br>) {<br>    Column(<br>        modifier = Modifier.fillMaxWidth(),<br>        horizontalAlignment = Alignment.CenterHorizontally<br>    ) {<br>        Spacer(modifier = Modifier.height(24.dp))<br><br>        Text(<br>            text = &quot;Bottom Sheet Title: $bottomSheetParameter&quot;, // We use the parameter here just to demonstrate<br>            fontSize = 24.sp,<br>            fontWeight = FontWeight.Bold<br>        )<br><br>        •••<br>}</pre><p>And we add a simple textfield to our SampleScreen to pass through a string.</p><pre>@Destination<br>@Composable<br>fun SampleScreen(<br>  navigator: DestinationsNavigator<br>) {<br>    var bottomSheetParameter by remember { mutableStateOf(&quot;&quot;) }<br><br>    Column(<br>        modifier = Modifier.fillMaxSize(),<br>        horizontalAlignment = Alignment.CenterHorizontally,<br>        verticalArrangement = Arrangement.Center<br>    ) {<br>        TextField(<br>            value = bottomSheetParameter,<br>            onValueChange = {<br>                bottomSheetParameter = it<br>            }<br>        )<br><br>        Spacer(modifier = Modifier.height(16.dp))<br><br>        Button(onClick = {<br>            navigator.navigate(<br>              SampleBottomSheetDestination(<br>                bottomSheetParameter = bottomSheetParameter // Note that destination object will be updated after you add the parameter<br>              ) <br>            )<br>        }) {<br>            Text(text = &quot;Open Bottom Sheet&quot;)<br>        }<br>    }<br>}</pre><p>And here’s the demonstration:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*TJ6lBOiszNeDW1gYVLWHFw.gif" /></figure><p>It’s really easy isn’t it? Now we take it further by returning a value from the bottom sheet itself.</p><h4>3. Returning value from bottom sheet</h4><p>To return a value from bottom sheet and observe it on the main screen, we have to use ResultBackNavigator. Simply add a parameter to the bottom sheet function that takes type of the result we want to return. In this case, it’s a string.</p><pre>@Destination(style = DestinationStyleBottomSheet::class)<br>@Composable<br>fun SampleBottomSheet(<br>  resultNavigator: ResultBackNavigator&lt;String&gt;<br>) {<br>    var sampleResultString by remember { mutableStateOf(&quot;&quot;) }<br><br>    Column(<br>        modifier = Modifier.fillMaxWidth(),<br>        horizontalAlignment = Alignment.CenterHorizontally<br>    ) {<br>        •••<br><br>        TextField(<br>            value = sampleResultString,<br>            onValueChange = {<br>                sampleResultString = it<br>            }<br>        )<br><br>        •••<br><br>        Button(<br>            onClick = { resultNavigator.navigateBack(sampleResultString) },<br>            modifier = Modifier.padding(horizontal = 12.dp, vertical = 18.dp)<br>        ) {<br>            Text(text = &quot;Continue&quot;, fontSize = 24.sp)<br>        }<br><br>        •••<br>}</pre><p>Afterwards, we add a ResultRecipient to our observing screen, <strong>SampleScreen</strong>. Recipient takes two parameters: observed bottom sheet’s generated Destination object and type of the result. Be aware, if we navigate back with a result parameter, result recipient will get a value with its NavResult. Which will enter the NavResult.Value case of our when expression. If we dismiss the bottom sheet, it will enter to Canceled case.</p><pre>@Destination<br>@Composable<br>fun SampleScreen(<br>  navigator: DestinationsNavigator,<br>  resultRecipient: ResultRecipient&lt;SampleBottomSheetDestination, String&gt;<br>) {<br>    var bottomSheetResult by remember { mutableStateOf(&quot;EMPTY&quot;) }<br><br>    resultRecipient.onNavResult { result -&gt;<br>        when (result) {<br>            is NavResult.Canceled -&gt; {<br>                bottomSheetResult = &quot;Bottom sheet canceled&quot;<br>            }<br><br>            is NavResult.Value -&gt; {<br>                bottomSheetResult = result.value<br>            }<br>        }<br>    }<br><br>    Column(<br>        modifier = Modifier.fillMaxSize(),<br>        horizontalAlignment = Alignment.CenterHorizontally,<br>        verticalArrangement = Arrangement.Center<br>    ) {<br>        Text(<br>            text = &quot;Result is: $bottomSheetResult&quot;,<br>        )<br><br>        Spacer(modifier = Modifier.height(16.dp))<br><br>        Button(onClick = {<br>            navigator.navigate(SampleBottomSheetDestination)<br>        }) {<br>            Text(text = &quot;Open Bottom Sheet&quot;)<br>        }<br>    }<br>}</pre><p>Result of our work can be observed as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*tFt2FCwq8cvzNjeJ2IiiRw.gif" /></figure><p>That’s it! I hope you all find it helpful with your projects.</p><blockquote>A huge thanks and congrats to <a href="https://github.com/raamcosta">Rafael Costa</a> for this amazing library!</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3o6fJ1BM7R2EBRDnxK%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fcongratulations-congrats-3o6fJ1BM7R2EBRDnxK&amp;image=https%3A%2F%2Fmedia4.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExeHpob284ejJicml2bHk1NTk5MHByaHhyYThvZ25hNHJ4NmxwN2t2YSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2F3o6fJ1BM7R2EBRDnxK%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="212" frameborder="0" scrolling="no"><a href="https://medium.com/media/0b3aa7df8695379b224ad2169bf966ff/href">https://medium.com/media/0b3aa7df8695379b224ad2169bf966ff/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e87ec765e5c0" width="1" height="1" alt=""><hr><p><a href="https://blog.simprasuite.com/jetpack-compose-bottom-sheet-management-e87ec765e5c0">Jetpack Compose Bottom Sheet Management</a> was originally published in <a href="https://blog.simprasuite.com/">Simpra Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Make Your MacOS Terminal Look Great]]></title>
            <link>https://blog.simprasuite.com/make-your-macos-terminal-look-great-76dceb96607e?source=rss-b1d9e5e559a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/76dceb96607e</guid>
            <category><![CDATA[macos]]></category>
            <category><![CDATA[terminal]]></category>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[command-line]]></category>
            <category><![CDATA[customization]]></category>
            <dc:creator><![CDATA[Tarik Yasar]]></dc:creator>
            <pubDate>Wed, 29 Jun 2022 07:24:45 GMT</pubDate>
            <atom:updated>2022-06-29T10:25:31.923Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*msZuhIo53lcwDiGw95zEyw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@heylagostechie">Mars Sector-6</a> on <a href="https://unsplash.com/">Unsplash</a></figcaption></figure><p>As developers and tech enthusiasts, the work of all of us falls on the terminal. But if you enjoy doing your work from the terminal like me, I would like to talk about the personalizations I applied to make my terminal more eye candy in MacOS.</p><h3>Terminal Emulator Configuration</h3><p>My terminal emulator of choice is <a href="https://iterm2.com/"><strong>iTerm2</strong></a>. Both in terms of aesthetics and the features it provides that I will show in a moment.</p><p>The first thing I do is to set the theme to Minimal from the Appearance tab because I like the solid one-color look without the window bar.</p><p>And then, from Preferences-&gt;Profiles-&gt;Session, there is a disabled button at the bottom of the window, enable that. And through “Configure Status Bar”, I add CPU Usage, Memory Usage, and Battery components to Status Bar to monitor them. You can drag and drop components into the “Active Components” section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jACcDbgUvyEmhpL1eBeffg.png" /><figcaption>“Status bar enabled” checkbox is situated at the bottom of the window</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SpUWY4U2s_Kp0RZRKZMMSg.png" /></figure><p>When it comes to the color scheme of the Terminal, I change it according to my wallpaper of choice. I use the Material Dark color scheme these days. That and more can be found <a href="https://iterm2colorschemes.com/"><strong>here</strong></a>.</p><p>My Terminal looks like this right now:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bd8fOM2CTOzWP6SGbLmCiQ.png" /></figure><p>Now we move forward to shell configuration!</p><h3>Shell Configuration</h3><p>I prefer to use Zsh as shell. It also is the default shell for MacOS. I install <a href="https://ohmyz.sh/">Oh My Zsh (OMZ)</a>. OMZ provides a lot of plugins and an easy way to customize your prompt. For example, you can monitor your Git statuses about a local repository, or you can attain a marvelous tool called <a href="https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/thefuck"><strong>The Fuck</strong></a> that corrects your typos. You can see the other plugins <a href="https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins"><strong>here</strong></a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/338/1*HbF9GXiyYAYkJ9ZAw5l7nw.png" /><figcaption>Example of Git plugin in a test repository</figcaption></figure><p>Installing OMZ is quite simple. You just enter this command to your terminal:</p><pre>sh -c &quot;$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)&quot;</pre><p>Once OMZ is installed, it comes with the default prompt theme called <em>robbyrussell</em> who is the creator of Oh My Zsh. You can find all of the default prompt themes here. Also you can list and set a theme by typing these commands:</p><pre>// Lists the themes<br>omz theme list</pre><pre>// Sets the given theme<br>omz theme set bira // This one is my favorite<br>omz theme set kiwi<br>omz theme set robbyrussel</pre><p>I prefer using a prompt theme called <em>bira</em>. I simply like the look of it. Now my Terminal looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ur-H1kIU4xJMVZZLtdzHJg.png" /></figure><p>Now its time for the small improvements and suggestions.</p><ul><li><strong>Sudo Password Prompt: </strong>Sudo password prompt is the prompt that we enter our password when the sudo command used. You can configure this prompt however you want by using -p parameter. You can do this by adding alias sudo=’sudo -p &quot;Your Custom Sudo Password Prompt: &quot;’ to your .zshrc file.</li></ul><p>Also by default, this password prompt does not give you a visual feedback when you pressed the keys. You can changing this by adding <em>pwfeedback</em> parameter to sudoers.tmp file. You can do this by simply typing sudo visudo and adding <em>pwfeedback</em> text right next to the <em>env_reset</em> by separating them with a comma.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WaXB49kwA0pBBsGagH2JKA.png" /></figure><p>Now you get a visual feedback and a custom prompt:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*Gx8Znfk_jJnLgSwhMKVopA.png" /></figure><ul><li><strong>Replacement For “ls” Command:</strong> <em>ls</em> command gives us the list of files and folder in the current or the given directory. <a href="https://github.com/Peltoche/lsd"><strong>lsd</strong></a> replaces this command with a superior one. It lists files and folders with the proper icons leading to the name of them.</li></ul><p>To install <em>lsd</em> type<em>: </em>brew install lsd</p><p>You can use <em>lsd</em> command or add alias ls=lsdto your .zshrc file to replace <em>ls</em> with <em>lsd</em>. This allows us to enter <em>ls</em> to call <em>lsd</em> command.</p><p>To do this type: echo &quot;alias ls=lsd&quot; &gt;&gt; ~/.zshrc</p><p>And for UTF-8 icons to show up right, you can install <a href="https://github.com/ryanoasis/nerd-fonts">Nerd Fonts</a>. I use Hack Nerd Font Mono.</p><p>You can install Nerd Fonts by typing these two commands:</p><pre>brew tap homebrew/cask-fonts<br>brew install --cask font-hack-nerd-font</pre><p>Once you installed the fonts, open Preferences and go to Profiles tab. From there go to Text tab and down below there is a Font section. You can set your font here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yyyLPRM_AU5a9qy9o6D-RA.png" /></figure><p>The result is like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dUPkxqDH3OuvtAsNNXlTVQ.png" /></figure><p>I am also going to give you a list of other tools and configurations.</p><ul><li>I use <a href="https://github.com/amix/vimrc">amix’s vimrc configuration</a>.</li><li>I install <a href="https://htop.dev/">htop</a> to monitor system processes.</li><li>I install <a href="https://github.com/dylanaraps/neofetch">neofetch</a> because it looks cool.</li><li>I install <a href="https://github.com/o2sh/onefetch">onefetch</a> because it looks cool and gives you statistics about a Git repository.</li></ul><p>I hope you like what you read in this article. If you’d like to check out, I have a <a href="https://github.com/tarikyasar/installation-script">Git repository</a> dedicated to my personal needs. It’s still a work in progress but it may be helpful for some people.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76dceb96607e" width="1" height="1" alt=""><hr><p><a href="https://blog.simprasuite.com/make-your-macos-terminal-look-great-76dceb96607e">Make Your MacOS Terminal Look Great</a> was originally published in <a href="https://blog.simprasuite.com/">Simpra Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Yeni Başlayanlar İçin Git — Bölüm 1]]></title>
            <link>https://blog.simprasuite.com/yeni-ba%C5%9Flayanlar-i%CC%87%C3%A7in-git-b%C3%B6l%C3%BCm-1-b95762b8d975?source=rss-b1d9e5e559a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/b95762b8d975</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[beginners-guide]]></category>
            <dc:creator><![CDATA[Tarik Yasar]]></dc:creator>
            <pubDate>Tue, 22 Feb 2022 13:13:07 GMT</pubDate>
            <atom:updated>2022-02-24T08:00:51.555Z</atom:updated>
            <content:encoded><![CDATA[<h3>Git Nedir?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*RHjoHkU7WmWtqk6KHjG20w.png" /></figure><p>Git, ücretsiz ve açık kaynak kodlu bir versiyon kontrol sistemidir. Peki versiyon kontrol sistemi nedir? Versiyon kontrol ise yazılım kodundaki değişikliklerin takip edilmesini ve yönetilmesini sağlayan bir sistemdir. Git, Linux çekirdeğinin de geliştiricisi olan Linux Torvalds tarafından Linux’un geliştirilmesinde kullanılmak üzere geliştirilmiştir.</p><p>Git bulunduğu dizindeki (ya da projedeki) dosyalarda yapılan değişiklikleri izler, böylece yapılanların kaydının tutulmasını sağlar ve ihtiyaç duyulduğunda da kaydedilmiş belirli sürümlere geri dönülmesini sağlar. Ayrıca birden çok kişinin yaptığı değişikliklerin tek bir kaynakta birleştirilmesine izin vererek işbirliğini kolaylaştırır.</p><p>Makalenin bu ilk kısmında Git kurulumundan ve Git’in terminal (ya da komut satırı) üzerinden temel kullanımından bahsedeceğim.</p><h3>Nasıl Kurulur?</h3><h4>Windows</h4><p>Windows için buradan yüklenebilir: <a href="https://git-scm.com/download/win">https://git-scm.com/download/win</a></p><h4>Linux</h4><pre># Debian/Ubuntu tabanlı dağıtımlar için<br>sudo apt install git</pre><pre># Fedora tabanlı dağıtımlar için<br>sudo dnf install git</pre><pre># Arch tabanlı sistemler için<br>sudo pacman -S git </pre><h4>MacOS</h4><p>MacOS’te Terminal’e git yazıldığında sistem otomatik olarak yükler. Eğer yüklenmezse Terminal’e şu komut girilir:</p><pre>xcode-select --install</pre><p>Eğer Git komut satırı üzerinden kullanılmak istenmezse masaüstü uygulaması olarak da kullanılabilecek alternatiflerden bazıları şunlardır:</p><ul><li><a href="https://www.gitkraken.com/">GitKraken</a></li><li><a href="https://www.sourcetreeapp.com/">Sourcetree</a></li><li><a href="https://desktop.github.com/">Github Desktop</a></li></ul><h3>Temel Git Kavramları</h3><h4>Git Deposu (Repository)</h4><p>Git repository’si, Git’te tutulan projeye ait dosyaları içeren bir kod deposudur. Bu kod deposu projenin farklı versiyonlarını bulundurabilir, projeye dair bir takım açıklamalar ve dokümantasyon içerebilir.</p><p>Örnek Git repository’leri:</p><ul><li><a href="https://github.com/torvalds/linux">Linux</a></li><li><a href="https://github.com/microsoft/vscode">Visual Studio Code</a></li></ul><p>Git repository’lerin tutulduğu en popüler servislere ise <a href="https://github.com/">Github</a>, <a href="https://gitlab.com/">Gitlab</a> ve <a href="https://bitbucket.org/">Bitbucket</a> örnek verilebilir.</p><h4>Branch Sistemi</h4><p>Branch sistemi, ana geliştirme çizgisinden ayrılıp bu ana çizgiyi bozmadan çalışmaya devam edilmesine olanak sağlar. Aşağıdaki şemada biri bug fix için diğeri ise yeni eklenecek bir feature için ana branch’ten oluşturulmuş iki ayrı branch gösterilmektedir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X83sKGrF8BEWU_cX_R1KCg.png" /></figure><h4>Merge İşlemi</h4><p>Merge işlemi, birden çok commit dizisini tek bir geçmişte birleştirmek için kullanılır. En yaygın kullanımı farklı branch’lerin birleştirilme durumlarıdır. Aşağıdaki şemada bu durum gösterilmektedir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c0pYVdSWnPwLtfs8fJr7Zw.png" /></figure><h4>.gitignore Dosyası</h4><p>Bu dosyada belirtilen dosyalar ve klasörler Git tarafından takip edilmez. Örneğin bir Android projesindeki build klasörünün ve içindekilerin kod deposuna (repository) yüklenmesi istenmez. Bu sebeple .gitignore dosyasına bu bilgi eklenerek takip edilmesi engellenir.</p><p>Örnek .gitignore dosyası:</p><pre># Gradle dosyaları<br>.gradle/</pre><pre># Build klasörü<br>build/</pre><pre># Lokal yapılandırma dosyası<br>local.properties</pre><pre># ...</pre><h3>Git Komutları</h3><h4>git config</h4><p>Git’e <strong>config</strong> komutuyla kullanıcının ismi ve mail adresi verilebilir. Kimin hangi geliştirmeyi yaptığının takip edilmesi kolaylıştırılır.</p><pre>git config --global user.name &quot;Isim Soyisim&quot;<br>git config --global user.email isimsoyisim@mail.com</pre><h4>git init</h4><p>Bulunan klasörü Git repository’si hâline getirir.</p><pre>git init</pre><p>Not: Eğer Terminal prompt’u buna uygunsa size bulunduğunuz klasörde Git’in olup olmadığını, bulunduğunuz branch adını belirtir.</p><p>Örnek:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wRo9Tdbje8D2MJqJCTWUhg.png" /><figcaption>Terminal Emulator: iTerm2, Shell: ZSH</figcaption></figure><h4>git add</h4><p>Her yeni dosya yaratıldığında, silindiğinde ya da bir dosyada değişiklik yapıldığında bunun Git’e söylenmesi gerekir. <strong>Add</strong> komutu da bu işi yapar.</p><p>Komut farklı şekillerde kullanılabilir:</p><pre># Spesifik bir dosya eklenebilir.<br>git add &lt;dosya_adi&gt;</pre><pre># Ya da bulunan klasördeki .gitignore dosyasında yer almayan<br># tüm dosyalar eklenebilir.<br>git add -A<br># ya da <br>git add .</pre><h4>git commit</h4><p><strong>Commit</strong> komutu geliştirme sürecindeki bir kontrol noktası olarak düşünülebilir. Geliştirme ortamında yapılan değişiklikleri kaydetmek için kullanılır.</p><pre># Tek satırlık commit mesajı için<br>git commit -m &quot;Örnek commit mesajı&quot;</pre><pre># Başlık ve açıklamalı commit mesajı için<br>git commit</pre><pre># Komutu girdikten sonra varsayılan text editörü açılacaktır.<br># Burada commit mesajı girildikten sonra kaydedilir ve commit<br># tamamlanmış olur.</pre><h4>git push</h4><p><strong>Commit</strong> komutuyla eklenmiş dosyaları repository’e yükler.</p><pre>git push &lt;remote-adi&gt; &lt;branch-adi&gt;</pre><pre># Örnek<br>git push origin develop<br>git push origin main</pre><h4>git clone</h4><p>Komuta parametre olarak verilen Git repository’sini bulunan konuma indirir.</p><pre>git clone https://github.com/torvalds/linux</pre><h4>git branch</h4><p>Verilen parametrelere göre branch oluşturma ya da var olan branch’ler üzerinde işlem yapılmasını sağlar.</p><pre># Repository&#39;deki branch&#39;leri listeler.<br>git branch<br># ya da<br>git branch --list</pre><pre># Parametre olarak verilen isimde branch oluşturur.<br>git branch &lt;branch_adi&gt;</pre><pre># Branch&#39;i güvenli (safe delete) şekilde siler. Yani merge&#39;lenmemiş<br># değişiklikler varsa silinmesini engeller.<br>git branch -d &lt;branch_adi&gt;</pre><pre># Branch&#39;i zorla siler (force delete). Merge&#39;lenmemiş değişiklikler<br># de silinir.<br>git branch -D &lt;branch_adi&gt;</pre><pre># Seçili olan branch&#39;in ismini değiştirir.<br>git branch -m &lt;yeni_branch_adi&gt;</pre><pre># Tüm remote branch&#39;leri listeler.<br>git branch -a</pre><h4>git checkout</h4><p>Komuta parametre olarak verilen isimdeki branch’e (eğer oluşturulmuşsa) geçer.</p><pre>git checkout &lt;branch_adi&gt;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b95762b8d975" width="1" height="1" alt=""><hr><p><a href="https://blog.simprasuite.com/yeni-ba%C5%9Flayanlar-i%CC%87%C3%A7in-git-b%C3%B6l%C3%BCm-1-b95762b8d975">Yeni Başlayanlar İçin Git — Bölüm 1</a> was originally published in <a href="https://blog.simprasuite.com/">Simpra Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>