What you need before you start
To upload a Winsurf project to GitHub, you need three things: a GitHub account (free), Git installed on your computer, and a Winsurf project folder ready to go. GitHub is where your files live online; Git is the tool that moves them there and tracks changes. You do not need to understand how Git works under the hood — you just need to know the specific steps to run.
If you do not have a GitHub account yet, go to github.com and click "Sign up". Use an email you check regularly, because GitHub will send you notifications about your repository. The free tier lets you create unlimited public and private repositories, so cost is not a barrier.
Next, read and install Git from git-scm.com. Choose the version for your operating system (Windows, Mac, or Linux). During installation, accept the default settings unless you have a specific reason to change them. After installation, open your terminal or command prompt and type git --version to confirm it worked. You should see a version number like "git version 2.40.0".
Key Takeaways
- Create a new repository on GitHub through your account dashboard, then copy the repository URL that GitHub gives you.
- Open your terminal in the Winsurf project folder and run git init, then git add ., then git commit -m "Initial commit" in that exact order.
- Connect your local folder to GitHub by running git remote add origin [your-repository-url], replacing the bracketed part with the actual URL.
- Push your files to GitHub by running git branch -M main and then git push -u origin main.
- After the first upload, you only need to run git add ., git commit -m "your message", and git push whenever you want to save changes.
Creating a repository on GitHub
Log into your GitHub account and look for the "+" icon in the top right corner of the page. Click it and select "New repository". GitHub will ask you for a repository name — use something that describes your Winsurf project, like "winsurf-portfolio" or "winsurf-dashboard". You can use lowercase letters, numbers, and hyphens, but not spaces.
Leave "Description" blank for now if you want to; you can add one later. Choose "Private" if this is a personal project you do not want others to see, or "Public" if you want it visible to everyone. For a first project, "Private" is usually the safer choice. Do not check the box that says "Add a README file" — you will create that yourself if you need it.
Click "Create repository". GitHub will show you a page with a URL that looks like https://github.com/your-username/your-repo-name.git. Copy this URL — you will need it in the next step. You can click the copy icon next to the URL to copy it to your clipboard.
Preparing your Winsurf project folder
Open your terminal or command prompt and navigate to the folder where your Winsurf project lives. On Mac or Linux, you can type cd /path/to/your/project. On Windows, use cd C:\path\to\your\project. If you are not sure of the path, you can drag the folder into the terminal window and it will fill in the path for you.
Once you are in the project folder, type git init and press Enter. This creates a hidden folder called ".git" that Git uses to track changes. You will not see it in your file explorer unless you turn on "show hidden files", but it is there.
Next, type git add . (note the period at the end). This tells Git to include all the files in your project folder. If you have files you do not want to upload — like temporary files, passwords, or API keys — you should create a file called .gitignore in your project folder and list those files in it, one per line. For now, if your project is small and clean, git add . is fine.
Making your first commit
A commit is a snapshot of your files at one moment in time. It has a message that describes what changed. Type git commit -m "Initial commit" and press Enter. The message "Initial commit" is a standard way to label the first upload of a project.
Git will ask you to set up your identity the first time you commit. It will tell you to run two commands with your name and email. Copy and run those commands exactly as Git shows them — they look like git config --global user.email "you@example.com". Use the email address you registered with GitHub.
After you set up your identity, run the commit command again: git commit -m "Initial commit". You should see a message that says something like "create mode 100644" followed by the names of your files. This means the commit worked.
Connecting your folder to GitHub
Now you tell Git where to send your files. Type git remote add origin followed by the repository URL you copied earlier. The full command looks like git remote add origin https://github.com/your-username/your-repo-name.git. Paste the URL you copied from GitHub, do not type it by hand.
Press Enter. Git will not print anything if it worked — silence is a good sign. If you see an error that says "fatal: remote origin already exists", it means you already ran this command. You can skip to the next step.
To double-check that the connection worked, type git remote -v. You should see two lines, both showing your repository URL. If you see that, you are ready to push.
Uploading your files to GitHub
Before you push for the first time, run git branch -M main. This renames your default branch to "main", which matches what GitHub expects. Then type git push -u origin main and press Enter.
Git will ask for your GitHub credentials. On Windows, a dialog box will pop up. On Mac or Linux, you will type your username and password in the terminal. Use your GitHub username and password, not your email. If you have set up two-factor authentication on GitHub, you will need to use a personal access token instead of your password — GitHub will show you how to create one if you need it.
After you authenticate, Git will upload your files. You will see a progress bar and then a message that says "Branch 'main' set up to track remote branch 'main' from 'origin'". Go to your GitHub repository page in your browser and refresh it. Your files should now be visible there.
Saving changes after the first upload
Once your project is on GitHub, the workflow is shorter. Every time you make changes you want to save, open your terminal in the project folder and run three commands in order:
- git add . (stages all your changes)
- git commit -m "describe what you changed" (creates a snapshot with a message)
- git push (sends the snapshot to GitHub)
For example, if you fixed a bug in your Winsurf code, you might run git commit -m "Fix navigation menu alignment". The message should be short and say what changed, not why. GitHub keeps a history of all your commits, so you can see exactly what you changed and when.
If you only changed a few files and do not want to upload all of them, you can use git add filename.js instead of git add . to stage just that file. But for most projects, git add . is simpler.
Frequently Asked Questions
What if I get an error that says "fatal: not a git repository"?
This means you are not in the project folder, or you did not run git init yet. Check that your terminal is open in the correct folder by typing pwd (Mac/Linux) or cd (Windows) to see the current path. If you are in the right folder, run git init again.
Can I upload a Winsurf project that is already on my computer?
Yes. Navigate to the project folder in your terminal, then follow the steps starting from "Preparing your Winsurf project folder". You do not need to create a new project — Git will track the files that already exist.
What should I put in the commit message?
Write a short phrase that describes what changed: "Add login form", "Update styling", "Fix bug in data validation". Avoid vague messages like "stuff" or "changes". Future you will be grateful when you need to find a specific change three months from now.
Is my code safe on GitHub if the repository is private?
Private repositories are visible only to you and people you invite. GitHub stores the files on their servers with encryption in transit. However, if your code contains passwords, API keys, or other secrets, do not push it to GitHub even in a private repository — use a .gitignore file to exclude those files instead.
Can I delete a repository if I change my mind?
Yes. Go to your repository page on GitHub, click "Settings" in the top right, scroll to the bottom, and click "Delete this repository". GitHub will ask you to type the repository name to confirm. Deletion is permanent and cannot be undone, so be sure before you do it.