Harnessing Git for SiteBay: A Comprehensive Guide

Traducciones al Español
Estamos traduciendo nuestros guías y tutoriales al Español. Es posible que usted esté viendo una traducción generada automáticamente. Estamos trabajando con traductores profesionales para verificar las traducciones de nuestro sitio web. Este proyecto es un trabajo en curso.
For a limited time:  Create a SiteBay account and WordPress Site
to try this guide for free.

For our bi-directional Git Sync, you don’t actually need to manage and a git repo on your computer. You can develop locally without any of the below, but if you want to learn the basics, read on.

Git is a cornerstone for managing software projects, offering powerful version control capabilities. Whether you’re launching your first WordPress site on SiteBay or managing a complex project, understanding Git is key. Follow these six steps to kickstart your journey with Git, from creating a repository to making your first commit and pushing it online. For a deeper dive, check out our extensive guide on Git Source Control Management.

Initialize Your Git Repository: Begin by setting up a dedicated folder for your project files, then initialize a Git repository within it:

mkdir myproject cd myproject git init

Create and Track Files: Generate some files for your project and add content to one as a starting point:

touch index.html style.css script.js echo “Hello SiteBay!” » index.html

Check Your Repository Status: Use git status to see which files Git is aware of and their status: git status

You’ll see something like: On branch master

Initial commit

Untracked files: (use “git add …” to include in what will be committed)

index.html style.css script.js

nothing added to commit but untracked files present (use “git add” to track)

Stage Files for Commit: Add index.html to Git’s tracking scope to monitor any future changes:

git add index.html git status

This shows Git is now tracking index.html:

On branch master

Initial commit

Changes to be committed: (use “git rm –cached …” to unstage)

new file: index.html

Untracked files: (use “git add …” to include in what will be committed)

style.css script.js

Commit Your Changes: Commit your changes to the version control system with a meaningful message:

git commit -am “Initial commit with index.html”

Confirmation of your commit will appear:

[master (root-commit) e8cc496] Initial commit with index.html 1 file changed, 1 insertion(+) create mode 100644 index.html

Track and Commit Remaining Files: Add all remaining files and commit them with a message describing the changes:

git add -A git commit -am “Added CSS and JS files”

Confirm the successful commit:

[master 52a9240] Added CSS and JS files 3 files changed, 1 insertion(+) create mode 100644 style.css create mode 100644 script.js

Note
git add -A, git add ., and git add -u all prepare files for a commit. git add -A stages all changes, git add . stages new and modified files (excluding deleted), while git add -u stages modifications and deletions (excluding new files).

This page was originally published on


Join the conversation.
Read other comments or post your own below. Comments must be respectful, constructive, and relevant to the topic of the tutorial. Do not post external links or advertisements. Before posting, consider if your comment would be better addressed by contacting our Support team or asking on our Community Site.
The commenting system for SiteBay Docs requires the acceptance of Functional Cookies, which allow us to analyze site usage so we can measure and improve performance. To view and create comments for this article, please update your Cookie Preferences on this website and refresh this web page. Please note: You must have JavaScript enabled in your browser.