Welcome to the Git-and-Github-Manual! This is a sample website project created to demonstrate the use of Git and GitHub.
Git is a version control system that allows you to keep track of changes made to your project over time.
- Git allows for version control, which means developers can keep track of changes made to the code and easily revert to earlier versions if necessary.
- Git enables collaboration by allowing multiple developers to work on the same codebase simultaneously.
- Git reduces the risk of code conflicts by providing a clear history of changes made to the code.
- GitHub is a web-based hosting service that provides a platform for software development teams to store and manage their Git repositories.
- GitHub allows for easy collaboration among team members by providing tools for code review and feedback.
- GitHub provides a centralized location for code, making it easy for team members to access and work on the same codebase.
- Clone the repository to your local machine using the following command in your terminal:
git clone https://github.com/dyells07/hotel-website.git
- Once you have made changes to the code, add the files to the staging area using the following command:
git add <filename>
- Commit the changes with a meaningful commit message using the following command:
git commit -m "Your commit message here"
- Push the changes to the remote repository using the following command:
git push origin <branch name>
- If you want to merge changes from another branch into your current branch, use the following command:
git merge <branch name>
- If you want to view the commit history, use the following command:
git log
- If you want to revert to a previous commit, use the following command:
git revert <commit hash>
- If you want to switch to a different branch, use the following command:
git checkout <branch name>
- If you want to create a new branch and switch to it, use the following command:
git checkout -b <new branch name>
- If you want to delete a branch, use the following command:
git branch -d <branch name>
GitHub is a web-based hosting service for version control using Git. It allows you to share your code with others and collaborate on projects. Here are some basic GitHub commands that you can use:
git remote add origin <repository URL>
: Sets the remote repository for your local Git repositorygit push -u origin <branch name>
: Pushes changes to the remote repositorygit pull
: Pulls changes from the remote repositorygit clone <repository URL>
: Clones a remote repository to your local machinegit branch
: Displays a list of branches in the repository
These are just a few of the basic Git and GitHub commands. For more information, please refer to the official Git and GitHub documentation.