20 F
Nashville
Friday, December 6, 2024

How to Install the Apache Web Server on CentOS Stream 9

Apache is available within CentOS's default software repositories, which means you can install it with yum.

How to Create Users in Linux

Linux is a multi-user system, meaning that more than one person can interact with the same system simultaneously.

How to Create Bash Aliases

This tutorial demonstrates how to use the alias command to create personalized shortcuts, which can help you save time and feel less frustrated.

Using Git for PHP Development

GitHub is a platform that allows developers to store their code in the cloud and collaborate. Git is a version control system that tracks file changes. In this article, we will focus on using Git with GitHub.

Create a new Git repository

git init

Display the status of the working directory

git status

Create an empty file in your root directory. Tell Git which files or folders to ignore in your project

touch .gitignore

To stage all files

git add .

To stage a specific file

git add [filename]

To stage a folder use

git add [folderpath]

Add all tracked files and the commit them with your message

git commit -m “first commit”

Rename the master branch to main

git branch -M main

Add a remote repository

git remote add origin <remote_repository_URL>

Replace ‘<remote_repository_URL>’ with the URL of your remote repository.

For example:

git remote add origin https://github.com/username/repository.git

Push the changes to the remote repository

git push -u origin main

git remote set-url origin https://<token>@github.com/<username>/<repo>

For information about personal access tokens:

https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens

Run the following to give you the git version number

git --version

Find out the current branch name

git branch

Track a branch’s commit history

git log

Verify the remote url

git remote -v

Copies an existing Git repository

git clone https://github.com/username/repository.git

Switch branches

git checkout <branch>

To revert changes to match a specific commit,

git reset --hard <some-commit>
git push --force

Check your configuration settings

git config --list

Configure Git. Let Git know who you are

git config --global user.name “<username>”
git config --global user.email “<email>”

See all possible commands

git help --all

Sign up for an account on GitHub:

https://github.com

For more information:

https://git-scm.com

Similar Articles

- A word from our sponsors -

Follow Us

Most Popular