<?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 Adam BEN KHALIFA on Medium]]></title>
        <description><![CDATA[Stories by Adam BEN KHALIFA on Medium]]></description>
        <link>https://medium.com/@AdamBenKhalifa?source=rss-7cf7a58d053e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fMGQ62GcJ0Pr0f72DXdLrw.jpeg</url>
            <title>Stories by Adam BEN KHALIFA on Medium</title>
            <link>https://medium.com/@AdamBenKhalifa?source=rss-7cf7a58d053e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 22:17:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@AdamBenKhalifa/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[Agency is The Key to AGI]]></title>
            <link>https://pub.towardsai.net/agency-is-the-key-to-agi-9b7fc5cb5506?source=rss-7cf7a58d053e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b7fc5cb5506</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[agi]]></category>
            <category><![CDATA[intelligence]]></category>
            <category><![CDATA[agents]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Adam BEN KHALIFA]]></dc:creator>
            <pubDate>Fri, 16 May 2025 12:02:31 GMT</pubDate>
            <atom:updated>2025-05-16T12:02:31.564Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kcZJOSVwAcgkxAjGKzRCqg.jpeg" /></figure><h4><strong>Why are agentic workflows essential for achieving AGI</strong></h4><p>Let me ask you this, what if the path to truly smart and effective AI , the kind we call <strong><em>AGI</em></strong>, isn’t just about building one colossal, all-knowing brain? What if the real breakthrough lies not in making our models only smarter, but in making them also capable of acting, adapting, and evolving?</p><p>Well, LLMs continue to amaze us day after day, but the road to <strong><em>AGI</em></strong> demands more than raw intellect. It requires <strong><em>agency.</em></strong></p><h3>Getting Our Terms Straight: AGI, Agency, and Agentic Workflows</h3><p>Before we dive in, let’s define the main concepts here:</p><h4>AGI — Artificial General Intelligence:</h4><p>You can see it as an AI model that can perform <em>any</em> intellectual task a human can. This means not just understanding language or generating images, but adapting, learning, reasoning, and acting across entirely new domains.</p><h4><strong>Agency:</strong></h4><p>The capacity of an entity to act purposefully in its environment to achieve goals. A rock has no agency; a human planning their day has plenty. For an AI, agency means it’s not just passively responding to prompts but actively pursuing objectives.</p><blockquote>Simply put, it’s the capacity to pursue goals autonomously through planning, acting, and adapting.</blockquote><h4><strong>Agentic Workflows:</strong></h4><p>If agency is the <em>“what”</em>, agentic workflows are the <em>“how”</em>. These are the dynamic processes and systems an AI uses to exercise its agency. Think beyond a simple input-output model.</p><p>Agentic workflows involve:</p><ul><li><strong><em>Autonomous Goal-Setting &amp; Planning:</em></strong> the AI doesn’t just execute a pre-defined plan, it can formulate goals and strategize how to achieve them.</li><li><strong><em>Tool Use &amp; Orchestration:</em></strong> like a skilled craftsperson, it can select, combine, and utilize various “tools” (other AI models, databases, APIs, code execution environments) to get the job done.</li><li><strong><em>Memory &amp; Learning: </em></strong>it remembers past actions, learns from successes and failures, and adapts its strategies over time.</li><li><strong><em>Adaptation in Dynamic Environments: </em></strong>the real world is messy, an agentic AI can adjust its plan when encountering unexpected obstacles or new information.</li></ul><blockquote>It’s vital to understand the difference here:</blockquote><blockquote>An LLM calling a weather API is just tool use. <br>An agentic workflow is when an LLM, tasked with “analyzing market trends for a new product,” autonomously decides to:<br>1) search recent financial news, <br>2) query a sales database, <br>3) use a data analysis tool to spot correlations, <br>4) ask a specialized forecasting model for projections, and then <br>5) compile a summary report, re-evaluating its approach at each step.</blockquote><blockquote>It’s like the difference between a single musician playing one note, and a conductor leading an entire orchestra.</blockquote><h3>The Limitation of Isolated Intelligence</h3><p>Let’s consider a human analogy. Imagine a brilliant engineer, a genius in their field. Now, strip away their tools: no computer, no internet for research, no pen and paper for sketching ideas or taking notes, no lab for prototyping, no colleagues to bounce ideas off. Confine them to only their thoughts. How much could they truly achieve? Their raw intellect, however vast, becomes severely handicapped when uncoupled from the ability to interact, experiment, and leverage external resources.</p><p>This “intelligence in isolation” scenario illustrates a fundamental truth: intelligence doesn’t operate in a vacuum. It thrives on interaction, tool use, and the ability to execute plans in the world. If we want AGI, we can’t just build a disembodied digital brain, we need to build something that can act.</p><h3>Agentic Workflows: AI can act like us, and perhaps even better</h3><p>Humans are masters of adapting their “workflows.” A painter uses different tools and processes than an engineer, who uses different methods than a chef. We intuitively understand context, choose the right approach, and even invent new methods when old ones fail.</p><p>Agentic workflows aim to achieve similar capabilities:</p><p><strong>Contextual Flexibility:</strong> An Agentic AI could switch between “investigative journalist mode” (querying databases, cross-referencing sources, interviewing) and “creative writer mode” (generating narratives, exploring styles) as needed for a complex task.</p><p><strong>Learning by Doing (and Re-doing): </strong>Human learning is an iterative workflow: observe, hypothesize, experiment, analyze, conclude, refine. Agentic systems can embody this, trying approaches, evaluating outcomes, and improving their strategies.</p><p><strong>Beyond Monolithic Thought:</strong> We don’t store everything in our heads. We use notes, computers, books, and critically, we delegate tasks to others. Agentic AI can similarly leverage external knowledge bases, specialized sub-agents, and computational tools, creating a distributed, more powerful form of intelligence.</p><p><strong>Thinking About Thinking:</strong> Humans possess meta-cognition — the ability to reflect on our own thought processes and adjust them. Agentic workflows, with their capacity for self-monitoring and re-planning, are a foundational step towards AI developing its own form of meta-cognition.</p><p><strong>Inventing New Ways:</strong> Perhaps soon enough, an advanced agentic AI won’t just use existing tools and workflows, but identify the need for entirely new ones and even contribute to their creation. A hallmark of true general intelligence.</p><h3>Not Just Helpful, But Mandatory: Why AGI Needs Agentic Workflows</h3><p>These capabilities aren’t just fancy add-ons. They are arguably essential for anything we’d recognize as AGI:</p><p><strong>Tackling Complexity:</strong> Real-world problems are messy, multifaceted, and rarely solved by a single, linear process. Agentic workflows will allow AI to break down these complex challenges into manageable sub-tasks, orchestrating diverse capabilities.</p><p><strong>Achieving Scale:</strong> Imagine trying to manage global logistics, conduct large-scale scientific research, or personalize education for millions with a single, rigid program. Agentic systems offer the modularity and dynamic coordination needed for such scale.</p><p><strong>Adaptability and Robustness:</strong> What happens when the data changes, a tool fails, or an assumption proves wrong? A static AI might grind to a halt. An agentic AI can adapt, re-plan, find alternative solutions, and continue pursuing its goal. It can handle the unexpected.</p><p><strong>Resourcefulness:</strong> Like our engineer, an AGI needs to be able to identify and use the right “tool” (be it a specific algorithm, dataset, or external service) for the job at hand, rather than trying to be a jack-of-all-trades with a single block massive model.</p><h3><strong>Surpassing Human Adaptability</strong></h3><p>The first step is for AI to achieve a human-like ability to set goals, plan, use tools, and adapt through agentic workflows. But the true promise of AGI lies in <em>surpassing</em> these capabilities:</p><ul><li><strong>Speed:</strong> Learn and adapt at speeds incomprehensible to us, iterating through problem-solving cycles in milliseconds.</li><li><strong>Scale:</strong> Manage and orchestrate operations of immense complexity, juggling thousands of variables and “tools” simultaneously.</li><li><strong>Novelty:</strong> Devise entirely new, perhaps counter-intuitive, workflows and solutions to problems that humans haven’t even conceived of.</li><li><strong>Self-Improvement of Workflows:</strong> An AGI that doesn’t just use workflows but actively refines, optimizes, and even discovers fundamentally new and more efficient ways to achieve its goals.</li><li><strong>Deeper Meta-Learning:</strong> Learning how to learn, plan, and strategize more effectively over time, becoming increasingly more intelligent and capable.</li><li><strong>Long-Horizon Reasoning:</strong> Successfully breaking down and navigating extremely complex, multi-stage goals that unfold over extended periods, adapting robustly along the way.</li></ul><p>Obviously, this is easier said than done. Building true AGI presents formidable challenges: How do we design systems that can reliably plan in open-ended environments? How can they discover and integrate new tools seamlessly? How does the system learn which part of a long, complex workflow was responsible for success or failure?</p><p>These are active areas of research, pushing the boundaries of what AI can do. Thankfully we are witnessing more and more breakthroughs everyday, and <strong><em>RL</em></strong><em> — Reinforcement Learning</em> based approaches are showing great promise (which make sense actually, but that’s for another article).</p><p><strong>Conclusion: Agency as the Cornerstone of AGI</strong></p><p>The quest for AGI is more than a race for larger models or faster processing. It’s a quest for intelligence that is versatile, adaptive, and purposeful. Agentic workflows provide the framework for such intelligence, enabling AI to move beyond mere pattern recognition to become an active participant in the problem-solving process.</p><p>Just as human collective general intelligence emerged not merely from neurons, but from networks of thought, culture, and action — we must build AGI not as a single-block model, but as an AI capable of learning, adapting, and acting. Agency, in this light, isn’t just a feature; it’s the fundamental engine that will drive us towards true Artificial General Intelligence.</p><p><em>If you liked this article, make sure to follow for more.<br>And you can find me on:</em></p><ul><li><strong><em>LinkedIn —</em></strong> <a href="https://www.linkedin.com/in/adambenkhalifa/">https://www.linkedin.com/in/adambenkhalifa/</a></li><li><strong><em>X —</em></strong> <a href="https://x.com/Thunderhead_exe">https://x.com/Thunderhead_exe</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p3_bl9mpjSdtYeR11W6Nhg.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b7fc5cb5506" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/agency-is-the-key-to-agi-9b7fc5cb5506">Agency is The Key to AGI</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An AI Agent to Replace Prompt Engineers]]></title>
            <link>https://pub.towardsai.net/an-ai-agent-to-replace-prompt-engineers-ed2864e23549?source=rss-7cf7a58d053e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed2864e23549</guid>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[prompt-engineer]]></category>
            <category><![CDATA[generative-ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[chatgpt]]></category>
            <dc:creator><![CDATA[Adam BEN KHALIFA]]></dc:creator>
            <pubDate>Thu, 24 Oct 2024 02:38:56 GMT</pubDate>
            <atom:updated>2024-10-28T03:50:27.746Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PaXLOOkrTD4vzoUrTJuoKg.jpeg" /></figure><p>Let’s build a multi-agent system that automates the prompt engineering process and transforms simple input prompts into advanced ones, <br>aka. An Advanced Prompt Generator!</p><p>We will see the idea behind this solution, the first iteration, the second iteration, and the testing, troubleshooting, and optimizations involved.</p><p>Eventually, we’ll have a robust prompt enhancer tool, and I’ll share links to the GitHub repository for this project and the Hugging Face Space for a quick demo of the agent at the end of this article.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/298/1*ZYZro3AUFSPEEvtsDdLebQ.gif" /><figcaption>Prompt Engineers right now</figcaption></figure><h3>Table of Content</h3><ul><li>The idea</li><li>Modeling and building the solution</li><li>Testing and troubleshooting</li><li>A stable and optimized solution</li><li>Conclusion</li></ul><h3>The idea</h3><p>After exploring various techniques for enhancing prompts, one idea clicked and stood out as particularly intuitive: <br>Utilizing a large language model (LLM) and guiding it with prompt engineering strategies and techniques to automate and generalize the process.</p><p>Here are the steps that were followed:</p><ul><li>Use OpenAI’s prompting strategies to define a set of rules that ensure the creation of an advanced prompt.</li><li>Define multiple agents to generate results based on the input prompt and the defined rules.</li><li>Create a pipeline to define the flow of interactions between the multiple agents</li></ul><p>Here’s a flowchart to better visualize these steps:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yMqj75YR1zWjZ_WR41qGdA.png" /><figcaption>The described solution’s flowchart</figcaption></figure><h3>Modeling and building the solution</h3><p>After we defined the rules, we modeled the pipeline. We will group these rules into specific components and assign an agent to each component. That means every agent will be instructed using a predefined prompt to generate information based on the given rules and input.</p><p>Here’s a flowchart to better visualize this step:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RqetMtQpeOovtA20GiH1-Q.png" /><figcaption>The pipeline’s flowchart</figcaption></figure><p>Now, all that is left is to code everything and add access to the LLM.</p><p>We will use OpenAI’s GPT-4o-mini as the LLM because it is really powerful, stable, and cost-efficient. However, you can adjust the code later to work with any LLM API.</p><h3>Testing and troubleshooting</h3><p>The results were promising, so we’re on to something here. We often achieved high-quality advanced prompts. However, there were multiple problems.</p><p>The performance was not stable, and we frequently encountered irrelevant results, such as generation output from the prompt, information redundancy, and hallucinations.</p><p>Therefore, we needed to optimize our solution.</p><h3>A stable and optimized solution</h3><p>The identified causes of the problems mentioned above were the overlap of certain components in the pipeline, the underdevelopment of the agent’s prompts, and a lack of restrictions within.</p><p>So, we revisited and updated our pipeline by reducing the number of components and providing robust, well-detailed system prompts for the agents to tackle each component.</p><p>Here’s a flowchart of the updated pipeline:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lCBXUEP_lvjHFGyKEpcn2Q.png" /><figcaption>The updated pipeline’s flowchart</figcaption></figure><p>With this update, we ensured a stable and robust system that resolved all the previous issues while reducing complexity and generation costs.</p><p>Here are some examples to evaluate the solution:<br><em>(You can also check the Github repo or the HF Space and try it yourself)</em></p><p>Example 1:</p><pre>&gt;&gt;&gt; INPUT PROMPT: <br>how to write a book?</pre><pre>&gt;&gt;&gt; ADVANCED PROMPT: <br>As a knowledgeable writing coach, please provide a comprehensive guide on how to write a book.<br><br>Requirements:<br>1. Outline the key steps involved in the book writing process, including brainstorming, outlining, drafting, and revising.<br>2. Offer tips for maintaining motivation and overcoming writer&#39;s block.<br>3. Include advice on setting a writing schedule and establishing a writing environment.<br>4. Suggest resources for further learning about writing techniques and publishing options.<br><br>Structure your response as follows:<br>- Introduction to the book writing journey<br>- Step-by-step guide with actionable tips<br>- Strategies for motivation and productivity<br>- Recommended resources for aspiring authors<br><br>Keep the response medium in length (approximately 200-300 words) to ensure thorough coverage of the topic.<br><br>##REFERENCE SUGGESTIONS##<br>- &quot;On Writing: A Memoir of the Craft&quot; by Stephen King<br>  Purpose: Offers insights into the writing process and practical advice for aspiring authors<br>  Integration: Use as a guide for understanding the nuances of writing a book<br><br>- &quot;The Elements of Style&quot; by William Strunk Jr. and E.B. White<br>  Purpose: Provides essential rules of English style and composition<br>  Integration: Reference for improving writing clarity and effectiveness<br><br>- &quot;Bird by Bird: Some Instructions on Writing and Life&quot; by Anne Lamott<br>  Purpose: Shares personal anecdotes and practical tips for overcoming writing challenges<br>  Integration: Use for motivation and strategies to tackle the writing process<br><br>##THOUGHT PROCESS##<br>*Subtask 1*:<br>- **Description**: Introduce the book writing journey and its significance.<br>- **Reasoning**: Providing an introduction sets the context for aspiring authors, helping them understand the importance and challenges of writing a book.<br>- **Success criteria**: The introduction should clearly articulate the purpose of writing a book and inspire readers about the journey ahead.<br><br>*Subtask 2*:<br>- **Description**: Outline the key steps involved in the book writing process: brainstorming, outlining, drafting, and revising.<br>- **Reasoning**: Breaking down the writing process into clear steps helps authors navigate their journey systematically and reduces overwhelm.<br>- **Success criteria**: Each step should be defined with actionable tips, such as techniques for brainstorming ideas, structuring an outline, and strategies for effective drafting and revising.<br><br>*Subtask 3*:<br>- **Description**: Provide tips for maintaining motivation and overcoming writer&#39;s block.<br>- **Reasoning**: Addressing common challenges like writer&#39;s block is crucial for sustaining progress and ensuring authors remain engaged with their writing.<br>- **Success criteria**: Include practical strategies, such as setting small goals, taking breaks, and using prompts to reignite creativity.<br><br>*Subtask 4*:<br>- **Description**: Advise on setting a writing schedule and establishing a conducive writing environment.<br>- **Reasoning**: A structured writing schedule and a supportive environment are essential for productivity and focus during the writing process.<br>- **Success criteria**: Offer specific recommendations for daily writing routines and tips for creating a distraction-free workspace.<br><br>*Subtask 5*:<br>- **Description**: Suggest resources for further learning about writing techniques and publishing options.<br>- **Reasoning**: Providing additional resources empowers authors to deepen their knowledge and explore various publishing avenues.<br>- **Success criteria**: List reputable books, websites, and courses that cover writing skills and the publishing process, ensuring they are accessible and relevant to aspiring authors.</pre><p>Example 2:</p><pre>&gt;&gt;&gt; INPUT PROMPT: <br>write a python script to compute and plot the fibonacci spiral</pre><pre>&gt;&gt;&gt; ADVANCED PROMPT: <br>As a programming expert, please create a Python script that computes and plots the Fibonacci spiral. <br><br>Requirements:<br>- Use the Fibonacci sequence to generate the necessary points for the spiral.<br>- Utilize libraries such as Matplotlib for plotting and NumPy for numerical calculations.<br>- Include comments explaining each step of the code.<br>- Ensure the script is modular, allowing for easy adjustments to the number of Fibonacci terms used in the spiral.<br><br>Provide the implementation with:<br>- Function to compute Fibonacci numbers up to a specified term.<br>- Function to plot the Fibonacci spiral using the computed points.<br>- Example usage demonstrating the script in action, including a plot display.<br><br>The Fibonacci spiral should start with the first few Fibonacci numbers and visually represent the growth of the spiral based on these values.<br><br>##REFERENCE SUGGESTIONS##<br>- Matplotlib Documentation<br>  Purpose: Provides details on plotting functions and customization options<br>  Integration: Reference for creating and customizing plots in the script<br>- Fibonacci Sequence Article<br>  Purpose: Offers insights into the mathematical properties and applications of the Fibonacci sequence<br>  Integration: Use as a reference for understanding the sequence&#39;s generation and its relation to the spiral<br>- Python Programming Guide<br>  Purpose: Serves as a comprehensive resource for Python syntax and libraries<br>  Integration: Reference for general Python programming practices and functions used in the script<br><br>##THOUGHT PROCESS##<br>*Subtask 1*:<br>- **Description**: Create a function to compute Fibonacci numbers up to a specified term.<br>- **Reasoning**: This function is essential for generating the sequence of Fibonacci numbers, which will be used to determine the points for the spiral.<br>- **Success criteria**: The function should return a list of Fibonacci numbers up to the specified term, with correct values (e.g., for n=5, it should return [0, 1, 1, 2, 3]).<br><br>*Subtask 2*:<br>- **Description**: Implement a function to plot the Fibonacci spiral using the computed points.<br>- **Reasoning**: Plotting the spiral visually represents the growth of the Fibonacci sequence, making it easier to understand the relationship between the numbers and the spiral shape.<br>- **Success criteria**: The function should create a plot that accurately represents the Fibonacci spiral, with appropriate axes and labels, and should display the plot correctly.<br><br>*Subtask 3*:<br>- **Description**: Include comments explaining each step of the code.<br>- **Reasoning**: Comments enhance code readability and maintainability, allowing others (or the future self) to understand the logic and flow of the script.<br>- **Success criteria**: The code should have clear, concise comments that explain the purpose of each function and key steps within the functions.<br><br>*Subtask 4*:<br>- **Description**: Ensure the script is modular, allowing for easy adjustments to the number of Fibonacci terms used in the spiral.<br>- **Reasoning**: Modularity allows users to easily modify the number of terms without altering the core logic of the script, enhancing usability and flexibility.<br>- **Success criteria**: The script should allow the user to specify the number of Fibonacci terms as an input parameter, and the plot should update accordingly.<br><br>*Subtask 5*:<br>- **Description**: Provide example usage demonstrating the script in action, including a plot display.<br>- **Reasoning**: Example usage helps users understand how to implement and run the script, showcasing its functionality and output.<br>- **Success criteria**: The example should include a clear demonstration of how to call the functions, specify the number of terms, and display the resulting plot, with expected output shown. </pre><h3>Conclusion</h3><p>In the end, we achieved very promising results. Of course, there is still a lot of room for improvement and further optimization, but most importantly, it was a fun project to work on. I’d love to hear your thoughts and ideas, so feel free to share them in the comments below!</p><p>GitHub repository: <a href="https://github.com/Thunderhead-exe/Advanced-Prompt-Generator">Link</a></p><p>Hugging Face Space: <a href="https://huggingface.co/spaces/Adam-Ben-Khalifa/Advanced_Prompt_Generator">Link</a></p><p>Let’s connect: <a href="https://www.linkedin.com/in/adambenkhalifa/">linkedin.com/in/adambenkhalifa</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed2864e23549" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/an-ai-agent-to-replace-prompt-engineers-ed2864e23549">An AI Agent to Replace Prompt Engineers</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Version control, Git, Github: A brief all-in-one guide for starters]]></title>
            <link>https://medium.com/@AdamBenKhalifa/version-control-git-github-a-brief-all-in-one-guide-for-starters-01baab29f95e?source=rss-7cf7a58d053e------2</link>
            <guid isPermaLink="false">https://medium.com/p/01baab29f95e</guid>
            <category><![CDATA[repositories]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Adam BEN KHALIFA]]></dc:creator>
            <pubDate>Fri, 30 Aug 2024 13:45:32 GMT</pubDate>
            <atom:updated>2024-09-04T16:58:13.751Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Version Control, Git, Github: A brief all-in-one guide for starters</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BsseoOKFUfxRJQ-smGf70w.jpeg" /></figure><blockquote><strong><em>TL;DR:</em></strong><br><strong>Version control </strong>is a concept, <br><strong>Git</strong> is a tool,<br><strong>Github</strong> is a service.<br>And we will explain them and see usage examples in a beginner friendly way!</blockquote><p><strong>Table of content:</strong></p><ul><li>What is Version Control?</li><li>What is Git?</li><li>What is Github?</li><li>Example: Adding a new project to Github</li><li>Example: Cloning and modifying a repo from Github</li><li>Example: Updating a local repo/ branch from a remote repo on Github</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OTLPjAQnorIQ6prtEdMZow.jpeg" /></figure><h4>What is Version Control?</h4><p>It is the practice of managing changes made to documents, programs, and directories (anything that changes over time or needs to be shared not only software, but in our case we will focus about code files).</p><p>Version control allows us to:</p><p>– Track files in different states and let multiple people work on the same files simultaneously, a concept known as continuous development (CD)</p><p>– Revert changes to any specific version of a file</p><p>– Combine different versions of a file</p><p>And much more!</p><blockquote>To better understand version control, think of it as a time machine for your work. Every time you make a change, it creates a snapshot of that moment. If something goes wrong or you want to see what things looked like before, you can travel back to any point in time and even bring back earlier versions.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BEHbyyVlH8oA5s2EsM0nKg.jpeg" /></figure><h4>What is Git?</h4><p>It is a version control system for software development and data projects. Think of Git as a memory card for code, it saves and keeps track of changes and progress.</p><p>Why Git? Mainly because it is open source and scalable.</p><p><strong>Using Git:</strong></p><p>Git commands are run on the Shell (Terminal)</p><blockquote><strong><em>Shell?<br></em></strong><em>It is a program for executing commands such as previewing, modifying, and inspecting files and directories.<br>Useful Shell Commands: pwd, ls, cd, nano, echo, mkdir, …</em></blockquote><p>We make changes in a repo <em>(short for repository: a fancy way to say folder)</em> through:</p><ul><li>Staging: Saving a draft by placing it in the staging area <br><em>(it’s like putting a letter in an envelope)</em></li><li>Committing: Updating the repo <br><em>(it’s like putting the envelope in the mailbox)</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_lwKhI_cuRgw5c4Y8lDtWA.jpeg" /></figure><h4>What is Github?</h4><p>A website for a cloud-based Git repository platform to host your projects with their saved progress.</p><p>And now we will explain some technical terms that we will see in the examples:</p><p><strong>Branches?<br></strong>Think of them as parallel versions of a project, and the default branch is called “main” (“master” in older versions of Github).</p><p>Branches are useful to make changes separate from the main branch then either delete it or merge it with the main branch.</p><p><strong>Copying a project: Cloning, Forking, and Branching:</strong></p><p>In short, Cloning, Forking, and Branching, all involve copying code from a repo but with different purpose and in different ways:</p><ul><li><strong><em>Forking:</em></strong> Making an independent copy of a repo on a remote server which is Github in our case</li><li><strong><em>Cloning:</em></strong> Downloading a repo to a local machine</li><li><strong><em>Branching:</em></strong> Parallel development on the same repo</li></ul><h4>Example: Adding a new project to Github</h4><p><strong>Before we start:</strong></p><p><strong>[ ! ] </strong>Make sure you have Git installed on your machine<br>you can check it by running this command in your terminal</p><pre>git --version</pre><p><strong>[ ! ] </strong>If it is your first time using Git and Github, you probably did not authenticate to Github from Git yet, I recommend using <a href="https://docs.github.com/en/get-started/getting-started-with-git/caching-your-github-credentials-in-git"><strong>git-credential-manager</strong></a>, it will make the process really easy.</p><p><strong>[ ! ] </strong>Configure your Git username and email</p><pre>git config --global user.name &quot;Your Name&quot;<br>git config --global user.email &quot;youremail@example.com&quot;</pre><p><strong>Now let’s start:</strong></p><ul><li>Open Github and create a repository <br>(make sure it’s empty, don’t include a README or LICENSE)</li><li>Open your terminal and navigate to your local project folder</li><li>Follow these commands:</li></ul><pre># Initialise Git in your folder:  <br>git init<br><br># Create a README file (optional but highly recommended):<br>touch README.md<br><br># Edit the README file in whatever way you want, in our case we&#39;ll use VSCode: <br>code .<br><br># Add all files to the staging area: <br>git add .<br><br># Commit your changes: <br>git commit -m “initial commit”<br><br># Feel free to check the modifications done:<br>git status<br><br># Make sure you are on the main branch:<br>git branch -M main<br><br># Connect to the remote repo (Copy URL from Github):<br>git remote add origin https://github.com/username/repository.git<br><br># Push the changes to the repo:<br>git push -u origin main</pre><p>Now you should have your project on your Github repo. One last recommended step is to add a LICENSE to your repo through the Github interface.</p><blockquote><strong><em>Note:</em></strong> If you select the option to add either a README or a LICENSE when creating a repo, you won’t be able to do the steps above. Instead you should follow the next example to clone the project first before pushing any files.</blockquote><h4>Example: Cloning and modifying a repo from Github</h4><ul><li>Through the main branch (if you are the owner/ a collaborator)</li></ul><pre># Clone the repo (Copy URL from Github):<br>git clone https://github.com/username/repository.git<br><br># Move to the project folder: <br>cd project_name<br><br># Make sure you are on the main branch:<br>git branch -M main<br><br># Make your changes (Example: creating new_file.py)<br>touch new_file.py<br><br># Add changes to the staging area: <br>git add .<br><br># Check the changes: <br>git status<br><br># Commit the changes: <br>git commit -m “added new_file.py”<br><br># Push the branch: <br>git push origin main</pre><ul><li>Through a PR (Pull Request)</li></ul><blockquote>By creating a PR, you’re asking the project maintainers to review the changes you’ve made in your own copy (branch). If they approve it, it will be merged into the main codebase. It’s a way to collaborate while ensuring quality.</blockquote><pre># Clone the repo (Copy URL from Github):<br>git clone https://github.com/username/repository.git<br><br># Move to the project folder: <br>cd project_name<br><br># Make a new branch:<br>git checkout -b version_1<br><br># Make your changes (Example: creating new_file.py)<br>touch new_file.py<br><br># Add changes to the staging area: <br>git add .<br><br># Check the changes: <br>git status<br><br># Commit the changes: <br>git commit -m “added new_file.py”<br><br># Push the branch: <br>git push origin version_1<br><br>&#39;&#39;&#39;Open Github, navigate to the project, and make a PR (Pull Request)<br>After verifying the changes, the owner of the repo can merge <br>your changes to the main branch&#39;&#39;&#39;</pre><h4>Example: Updating a local repo/ branch from a remote repo on Github</h4><pre># Connect to the remote repo (Copy URL from Github):<br>git remote add origin https://github.com/username/repository.git<br><br># Switch to the main branch: <br>git switch main<br><br># Pull the changes: <br>git pull<br><br># Switch the branch: <br>git switch version_1<br><br># Merge the main branch to the specified branch: <br>git merge main</pre><p>That’s all for now, I hope you found this guide useful, and see you in the next article!</p><p><strong><em>— Adam BEN KHALIFA</em></strong></p><p>[ Feel free to follow me on <a href="https://www.linkedin.com/in/adambenkhalifa/">LinkedIn</a>, and <a href="https://github.com/Thunderhead-exe">Github</a>. Bye!]</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=01baab29f95e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>