how to start coding in github #178141
Replies: 2 comments
-
| Coding किसलिए karna चाहता web app ki native app बनाना ki kuch और .kis platform par करना hai mobile ya pc.ai ki मदद se coding kar sakta | 
Beta Was this translation helpful? Give feedback.
-
| Hello @omenaijessica17, and welcome to GitHub! This is a very common question, and it's the most important concept to learn first. You don't actually code in GitHub. You code on your own computer and then use GitHub to store, share, and manage that code. Think of GitHub as a "Google Drive" or "Dropbox," but specifically designed for code. You write your files (like  Here is a full guide to get you from an empty folder to a live website. Part 1: Your Coding Toolkit (The Setup)First, you need two pieces of free software on your computer. 
 Part 2: Step-by-Step: Your First Website ProjectLet's make a simple website and put it on GitHub. Step 1: Create a "Repository" on GitHubA repository (or "repo") is like a project folder on GitHub. 
 Step 2: Write Your Code on Your ComputerNow, let's write the code for your website. 
 
 <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My First Website</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <h1>Hello, GitHub!</h1>
    <p>This is my first project.</p>
    <button id="colorButton">Click Me!</button>
    <script src="script.js"></script>
</body>
</html>
 body {
    font-family: Arial, sans-serif;
    display: grid;
    place-items: center;
    min-height: 100vh;
    background-color: #f0f0f0;
    text-align: center;
}
h1 {
    color: #333;
}
button {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background-color: #0366d6;
    color: white;
    border: none;
    border-radius: 5px;
}
 // Get the button element from the HTML
const button = document.getElementById('colorButton');
// Add an event listener to run code when it's clicked
button.addEventListener('click', () => {
    // Get a random color
    const randomColor = '#' + Math.floor(Math.random()*16777215).toString(16);
    
    // Change the background color of the page
    document.body.style.backgroundColor = randomColor;
});You now have a simple, complete website sitting in a folder on your computer! You can even double-click the  Step 3: Connect and "Push" Your Code to GitHubThis is the final step. We will use Git Bash (the tool you installed) to send your local code to your GitHub repo. 
 git init
 git add .(Note: The  
 git commit -m "My first website commit"
 
 git remote add origin [https://github.com/YourUsername/my-first-website.git](https://github.com/YourUsername/my-first-website.git)
 git branch -M main
 git push -u origin main
 
 
 Part 3: Bonus! Put Your Website Online Now that your code is on GitHub, you can host it as a real, live website for free using GitHub Pages. 
 You can now share this link with anyone to show them your first live website! That is the basic workflow: Code locally in VS Code, then use Git to  | 
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I just started my account in github in less than two weeks and I still don't know how to code in github
Beta Was this translation helpful? Give feedback.
All reactions