Skip to content

This repository contains detailed information about using Git and GitHub. It explains the basic concepts, terminology, and usage of Git. It also provides information on how to use the GitHub platform.

Notifications You must be signed in to change notification settings

mces58/GitTutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 

Repository files navigation

git&github

Git & Github

Git is a software used as a distributed version control system (VCS). It is utilized to track changes in software projects, manage different versions, and collaborate effectively. Git operates swiftly, flexibly, and reliably.

GitHub is a cloud-based platform built upon Git. It allows you to host, share, and collaborate on projects.


đź’ˇBefore diving into Git usage, let's take a look at some essential terminal commands.

Here are some basic terminal commands:

  • ls: It lists the files and folders in the current directory.

  • ls -la: It lists the files and folders in the current directory in detail, showing permissions, owners, and other attributes of the files.

  • cd [directory]: It changes the directory to the specified one.

  • cd ..: It allows the user to move up one directory level from the current directory, effectively navigating to the parent directory.

  • mkdir [folder name]: It creates a new folder.

  • rmdir: It is used to delete the specified folder (directory). However, the folder must be empty. If there are files or subfolders inside the folder, the rmdir command will not work. If files or subfolders need to be deleted as well, the rm -rf command should be used.

  • touch [file name]: It creates a new file.

  • rm [file name]: It deletes the specified file.

  • cp [source] [destination]: It copies the source file to the destination location.

  • mv [source] [destination]: It moves the source file to the destination location.

  • cat [file name]: It prints the content of the file to the terminal.

  • grep [word] [file name]: It finds the lines containing the specified word.

  • chmod [permissions] [file name]: It changes the permissions of the file.

  • pwd: It shows the current working directory. You can use this command to find out in which directory you are located.

  • echo 'message' > [file name]: Writes a "message" containing text or a string of characters to the specified file.

  • nano [file name]: Used to open and edit a file.

These commands will suffice for basic terminal usage.

👉 Now that we have covered the basic terminal commands, we can move on to Git commands.

Command Description
git config It is used to configure or view Git configuration settings.
git init It is used to initialize an existing directory as an empty Git repository.
git clone It is used to create a local copy from a remote Git repository.
git add It prepares the changes in the working directory to be tracked by Git.
git commit It saves the changes staged in the working directory to a local Git repository.
git diff It shows the differences between the working directory and the index, or between the index and the last commit.
git reset It is used to undo changes made in Git or to edit the index.
git revert Instead of reverting the changes of the previous commit, it allows creating a new commit to undo those changes.
git restore It is used to revert the contents of the working directory or specific files to their previous commit state or to change them.
git status It shows which files have been modified in the working directory, which ones are staged in the index, and which ones are awaiting commit.
git rm It is used to remove a file or directory from the Git repository.
git log It is used to view the commit history in a Git repository.
git show It is used to display the changes and commit details of a specific commit detail.
git tag It is used to add changes in the working directory to the index for Git to track.
git branch It is used to list the existing branches in the current Git repository or to create a new branch.
git checkout It is used to switch between branches in a Git repository, navigate to a specific commit, or create a new branch.
git switch It is a command used in Git version 2.23 and later. This command is used to switch between branches in Git repositories.
git merge It is used to merge changes from different branches.
git remote It is used to manage remote Git repositories and interact with them.
git push It is used to push local commits to a remote Git repository.
git fetch It is used to fetch new information from a remote Git repository to the local repository, but it does not make any changes to the current working directory.
git pull It is used to pull the latest information from a remote Git repository and apply these updates to your local working directory and current branch.
git stash It is used to temporarily store changes you are working on but haven't committed yet, and to clean your working directory.

đź‘€ Now let's look at the commands in more detail.

01 Git Configuration

git help
    This command typically opens the help documentation related to Git commands. Additionally, you can use git help -a to display an alphabetical list of all Git commands. This provides a quick overview of all Git commands.
git config --global user.name "your name"
    It is used to configure Git settings. This command is used to set the username and is typically defined as a global setting, meaning the username applies to all Git projects on the system.
    This setting is important for specifying which user made the changes, especially during commit operations.
git config --global user.email "your-email@example.com"
    It is used to configure Git settings. This command is used to set the user's email address and is typically defined as a global setting, meaning the email address applies to all Git projects on the system.
    This setting is important for specifying which user made the changes, especially during commit operations.
git config --global core.editor "code -w"
    This is used to set the user-defined text editor for Git. In this example, it specifies the use of Visual Studio Code (code), and the -w option ensures that Git waits for the editor to close before proceeding. This means you can continue with commit messages or other editing tasks without waiting for Visual Studio Code to close.
git config --list(-l)
    Used to list Git configuration settings. This command displays the configuration settings and values used by Git.
    For example, you can use this command to view the username, email address, color preferences, and other settings defined in the Git configuration. The output is typically in key=value format and includes the configured settings for Git.

02 Starting a Project

git init [project name]
    Used to initialize an existing directory as a Git repository. If [project name] is specified, a folder with this name is created, and the Git repository is initialized within this folder.
    mkdir my_project
    cd my_project
  • Now, let's initialize this directory as a Git repository using the git init command:
  • git init
  • This process turns the current directory into an empty Git repository. You can now track files in this directory, commit changes, and use Git's version control features. If you use git init my_project, a folder named my_project will be created, and the Git repository will be initialized inside that folder.
  • When the git init command is executed, Git initializes the current directory as a Git repository and adds a subdirectory named .git. This subdirectory contains all the information and configuration settings for the Git repository. Therefore, running the git init command creates a Git repository and generates the .git directory that holds all the related information.
  • However, if you want to undo this process and delete the Git repository, simply deleting the .git directory is enough. However, this action is irreversible, and you will lose all history, commit information, branch structures, and other related data. Therefore, you should proceed with caution when deleting the directory.
  • For example, after creating a Git repository, you can follow the steps below to delete the repository (use with caution):
  • rm -rf .git
  • This command completely deletes the .git directory in the current directory.
  • When the -r (recursive) and -f (force) options are included, it deletes the specified directory, along with all files and subdirectories within it, without prompting for confirmation.
git clone <project url>
    Used to copy a project from a remote Git repository to a local machine. This command downloads the specified Git repository in its entirety and creates a local copy. The <project url> represents the URL of the Git repository to be cloned.
  • As an example, to clone a GitHub repo:
  • git clone https://github.com/user/repo-path.git
  • This command downloads the specified GitHub repository and creates a folder named repository-name in the current directory, copying the contents into it. This allows you to use the entire project on your local machine and make changes to it.

03 Day-to-day Work

git status
    Displays the status of files in the working directory and index of a Git repository. This command is used to see which files have been modified, which are staged in the index, and which are waiting to be committed. Here are some example usages of the git status command:
  • Create a new directory and switch to this directory:
  • mkdir my_project
    cd my_project
  • Check the directory status using the git status command:
  • git status
  • The output will be like this:
  • fatal: Not a git repository (or any of the parent directories): .git
  • This output indicates that the directory is not yet a Git repository. Therefore, when the git status command is run, Git reports that no repository has been initialized in the directory and returns an error.
  • Now, let's create the Git repository:
  • git init
  • Check the directory status using the git status command again:
  • git status
  • The output will be like this:
  • On branch master
    No commits yet
    nothing to commit (create/copy files and use "git add" to track)
  • This output indicates that the Git repository has been created successfully, but no commits have been made yet and there are no files being tracked.
git add [file]
    The git add command is used to add changes in the working directory to the staging area for Git to track. Here are some examples of using the git add command:
  1. Staging a Single File:

  2. # Create a new file
    echo "This is an example file" > file.txt
    
    # Add the file to the stage git add file.txt
    In this example, a file named file.txt was created in the working directory and added to the staging area using the git add command
  3. Staging Multiple Files:

  4. # Create new files
    echo "hello world 1" > file1.txt
    echo "hello world 2" > file2.txt
    
    # Add all files to stage git add file1.txt file2.txt
    In this example, we added multiple files to the stage at once.
  5. Staging All Changes:

  6. # Add all changes in the working directory to the staging area
    git add .
    In this example, the . (dot) represents all changes in the working directory. The git add . command stages all files.
  7. Staging Files of a Specific Type:

  8. # Only add files with .txt extension to stage
    git add *.txt
    In this example, we only include files with the .txt extension.
  9. Unstaging Changes:

  10. # Unstage a file from the staging area
    git reset file.txt
    In this example, we are unstageing the file file.txt that we previously added to the staging area.
git diff [file]
    The git diff [file] command is used to show changes in a Git repository. This command is useful for comparing differences between commits, branches, or file versions. Here are the basic usages and examples of the git diff command:
  1. Showing Differences Between the Working Directory and the Staging Area:

  2. git diff
    This command shows changes that have not yet been added to the Staging Area.
  3. Showing Differences Between the Staging Area and the Last Commit:

  4. git diff --cached
    This command compares the changes in the Staging Area with the last commit.
  5. Showing Differences Between Two Specific Commits:

  6. # git diff commit_id1 commit_id2
    git diff abc def
    This command shows the differences between abc and def commits
  7. Showing Changes in a Specific File:

  8. # git diff file_name
    git diff app.js
    This command shows changes in the app.js file.
  9. Showing Differences Between a Specific Commit and the Current State:

  10. # git diff commit_id
    git dif abc
    This command shows the differences between the abc commit and the current status.
  11. Showing Differences Between a Different Branch and the Current State:

  12. # git diff other_branch_name
    git dif feature-branch
    This command shows the differences between the feature-branch branch and the current state.
git checkout -- [file]
    The git checkout command is used to switch between branches, view commits, create new branches, and revert files in the working directory within a Git repository. However, starting from Git 2.23, the git switch and git restore commands have taken over some of the responsibilities of git checkout. Here are the basic uses of the git checkout command:
  1. Changing Branch:

  2. # git checkout branch_name
    git checkout main
    This command switches to the main branch.
  3. Creating a New Branch and Changing:

  4. # git checkout -b new_branch_name
    git checkout -b feature-xyz
    This command creates a new branch named feature-xyz and automatically switches to this branch.
  5. Reverting Files to a Specific Commit or Branch State:

  6. # git checkout -- file_name
    git checkout -- index.html
    This command rolls the index.html file back to its last commit state.
  7. Going to a Specific Commit:

  8. # git checkout commit_id
    git checkout abc123
    This command is used to go to the abc123 commit id.
  9. Viewing the State of a Specific Commit on a Specific Branch:

  10. # git checkout branch_name -- file_name
    git checkout main -- index.html
    This command puts the index.html file of the main branch into a specific commit state.
git switch
    The git switch command, introduced in Git version 2.23, is designed for switching between branches. This command allows you to move from the current branch to another branch. It replaces the git checkout command for branch switching, providing a safer and more explicit tool. Here are the basic usages and examples of the git switch command:
  1. Switching to Branch:

  2. # git switch branch_name
    git switch feature-branch
    This command switches to the branch named feature-branch.
  3. Creating and Switching to a Branch:

  4. # git switch -c new_branch_name
    git switch -c new-feature
    This command creates a new branch named new-feature and switches to this branch.
  5. Match and Switch to a Remote Branch with the Current Branch:

  6. # git switch --track remote_repo_name/remote_branch_name
    git switch --track origin/main
    This command matches the current branch with a branch in the remote repository and switches to this branch.
  7. Saving Changes Before Switching Branches:

  8. # git switch -c new_branch_name --discard-changes
    git switch -c new-feature --discard-changes
    This command creates a new branch named new-feature, but does not save changes to the existing branch.
git commit
    The git commit command is used to permanently save changes in your working directory. Here are the basic uses and some examples of the git commit command:
  1. Basic Commit Process:

  2. # git commit -m "Commit Description"
    git commit -m "Update homepage design"
    The git commit command allows you to permanently save changes that are staged (in the Staging Area). When used with the -m parameter, you can add a commit message. The message is important for describing the changes you have made.
  3. Committing All Files in the Staging Area:

  4. git commit -a -m "Update all files"
    If you want to commit all changes in the Staging Area, you can use the -a (all) parameter. This commits all changes to tracked files without needing to explicitly stage them. However, be cautious when using this method, as it does not include untracked new files in the commit.
  5. Editing Changes:

  6. git commit --amend -m "fix: Commit Description"
    If you notice an error in your last commit or need to change the commit message, you can use the --amend parameter. This command updates your most recent commit.
git rm [file]
    The git rm command removes a file or directory from version control in a repository. The removed file or directory will no longer be tracked, and this change will take effect in the next commit. However, the file or directory is not physically deleted; it is only untracked.
  1. Stop Tracking the File:

  2. # git rm file_name
    git rm myFile.txt
    This command stops tracking the myfile.txt file, and the change will take effect in the next commit.
  3. Stop Tracking and Remove the File:

  4. # git rm -f file_name
    git rm -f myFile.txt
    This command both stops tracking the myfile.txt file and physically deletes it. The -f option forces the deletion, even if the file has been modified.

04 Storing Your Work

git stash
    The git stash command is used to temporarily save changes in the current branch. This is useful when you want to save your work without committing it, allowing you to switch branches or work on something else without losing progress. Here are the basics of git stash usage and examples:
  1. Saving Changes:

  2. git stash
    git stash saves all changes in the working directory to a temporary storage location called a stash. This allows you to return your current branch to a clean state while keeping your changes safe for later use.
  3. Viewing the Stash List:

  4. git stash list
    This command displays the stash list and shows each stash named with an index number.
  5. Applying a Specific Stash:

  6. # git stash apply stash_index_number
    git stash apply 0
    This applies the first stash in the stash list. The apply command applies the stash but does not delete it. If you want to apply and delete the stash simultaneously, you can use git stash pop.
  7. Applies and deletes the stash:

  8. # git stash pop stash_index_number
    git stash pop 0
    This command applies the first stash from the stash list and deletes it.
  9. Inspecting a Specific Stash:

  10. # git stash show stash_index_number
    git stash show 0
    This command shows the changes of the first stash in the stash list.
  11. Deleting All Stashes:

  12. git stash clear
    This command completely clears the stash list.

05 Git Branching Model

git branch
    The git branch command is used to list branches, create new branches, switch between branches, and delete branches in a Git repository. Here are the basic usages and some examples of the git branch command:
  1. Listing Branches:

  2. git branch
    This command lists the current branches and shows which branch you are on. The active branch is indicated with an asterisk (*) symbol.
  3. Creating a New Branch:

  4. # git branch new_branch_name
    git branch feature-xyz
    This command creates a new branch named feature-xyz but does not automatically switch to it. You continue working on the current branch.
  5. Change Branch (Checkout):

  6. # git checkout target_branch_name
    git checkout feature-xyz
    
    # Alternatively, in Git 2.23 and later # The following command can also be used: # git switch target_branch_name git switch feature-xyz
    git checkout and git switch commands allow you to leave the current branch and switch to another branch.
  7. Creating a New Branch and Switching:

  8. # git checkout -b new_branch_name
    git checkout -b feature-abc
    This command creates a new branch named feature-abc and automatically switches to that branch.
  9. Deleting Branch:

  10. # git branch -d branch_name_to_delete
    git branch -d feature-xyz
    This command deletes the branch named feature-xyz. However, if there are unmerged changes in this branch, the deletion will not proceed. You can forcefully delete the branch using git branch -D, but you should be cautious in this case.
git merge
    git merge command is used to combine different branches. It is typically used when you want to add changes made on a feature branch to the master branch or merge changes from different branches. Here is the basic usage of the git merge command along with examples:
  1. Merging a Specific Branch into the Current Branch:

  2. git checkout master # switch to the branch to be merged
    git merge feature-xyz # merge feature-xyz branch into master branch
    
    # or use with switch command git switch master git merge feature-xyz
    These commands merge the feature-xyz branch into the current branch.
  3. Fast Forward Merge:

  4. If the changes on a branch were made after the latest commit on the target branch (the branch to be merged), Git performs a 'Fast Forward' merge. In this case, no separate commit is created.

    git checkout master
    git merge feature-xyz
    This command merges the master branch into the feature-xyz branch. If a Fast Forward merge occurs, you will see that the master branch now points to the same commit as the feature-xyz branch's latest commit.
  5. Non-Fast Forward Merge:

  6. If there are changes made between the branch being merged and the target branch, and Fast Forward merge is not possible, Git will create a new commit to complete the merge.

    git checkout master
    git merge --no-ff feature-xyz
    The --no-ff parameter forces a non-fast-forward merge, creating a new commit even if a fast-forward merge is possible.
  7. Handling Conflicting Changes:

  8. If there are conflicting changes during the merge process, Git will not be able to complete the merge automatically. In this case, manual intervention may be required.

    git checkout master
    git merge feature-xyz
    If there are conflicts, Git will show you the conflicting files and ask you to resolve the conflicts by editing them. After resolving the conflicts, you can mark the files as resolved and proceed with the commit.
  9. Merge with a Specific Commit:

  10. # git merge commit_id
    git merge abc123
    This merges the current branch with a specific commit.

06 Inspect History

git log
    git log command is used to view the commit history of a Git repository. This command provides a list containing details such as commit IDs, authors, dates, and commit messages. Here are the basic usages and some examples of the git log command:
  1. Basic Usage:

  2. git log
    This command displays a series of information for each commit. Each commit's unique identifier (hash), author, date, and commit message are listed.
  3. Shortening Commit Information:

  4. git log --oneline
    This command displays only a shortened commit ID and the commit message for each commit.
  5. Graphical Representation:

  6. git log --oneline --graph
    This displays commits in a graphical format, showing branches and merges.
  7. Displaying Commit History for a Specific Directory or File:

  8. # git log file_name
    git log index.html
    This command displays the commit history exclusively for the index.html file.
  9. Displaying Commits Up to a Specific Date:

  10. git log --until=2025-01-01
    This command lists the commits up to the specified date.
  11. Displaying the commits made by a specific author:

  12. # git log --author="author_name"
    git log --author="mces58"
git show
    git show command provides detailed information about a specific commit, branch, or tag in Git. This command displays the changes made in a commit, the commit message, and details about modified files. Below are the basic uses and examples of the git show command:
  1. Displaying a Specific Commit:

  2. # git show commit_id
    git show abc123
    This command displays detailed information about the commit with the ID abc123, including the changes, commit message, and other details.
  3. Display the Last Commit:

  4. git show
    This command displays the details of the most recent commit. If you are working on HEAD, it shows the latest commit.
  5. Showing a Specific Branch or Tag:

  6. # git show branch_name
    git show main
    # git show v1.0.0
    This command shows the details of the latest commit on the main branch. It can also be used for tags.
  7. Show changes for a specific file:

  8. # git show commit_id file_name
    git show abc123 index.html
    This command shows the changes made to the index.html file in a specific commit.
  9. Show changes in color:

  10. git show --color commit_id
    This command displays the changes in color, making it easier to read.
  11. Line-by-Line Comparison of Changes:

  12. git show -v commit_id
    This command shows the changes in a specific commit, comparing them line by line.

07 Tagging Commits

git tag
    The git tag command is used to add a tag to a specific commit or manage existing tags in a Git repository. Tags typically represent the name, version number, or description of a specific release or significant point in the repository's history. Here are the basic uses of the git tag command with examples:
  1. Creating a Tag:

  2. # git tag tag_name
    git tag v1.0.0
    This command adds a tag named v1.0.0 to the current HEAD commit.
  3. Adding a Tag to a Specific Commit:

  4. # git tag tag_name commit_id
    git tag v1.0.0 abc123
    This command adds a tag named v1.0.0 to a specific commit (here represented as abc123).
  5. Creating Annotated Tags:

  6. # git tag -a tag_name -m "Tag Description"
    git tag -a v1.0.0 -m "Stable version"
    This command creates a tag named v1.0.0 with a description.
  7. Listing Tags:

  8. git tag
    This command lists available tags.
  9. Showing a Specific Label Version:

  10. # git show tag_name
    git show v1.0.0
    This command shows the details of the tag named v1.0.0.
  11. Deleting a Specific Tag:

  12. # git tag -d tag_name
    git tag -d v1.0.0
    This command deletes the tag named v1.0.0 locally.
  13. Push Tag to Remote Repository:

  14. # git push remote_repo tag_name
    git push origin v1.0.0
    This command pushes a specific tag to the remote repository.
  15. Push All Tags to Remote Repository:

  16. # git push remote_repo --tags
    git git push origin --tags
    This command sends all tags to the remote repository.

08 Reverting Changes

git reset [<path>...]
    The git reset command is used to modify the commit history of a branch and revert files in the working directory. This command should be used carefully, as it changes history and is generally not recommended on shared branches. Here are the basic uses and examples of the git reset command:
  1. Reverting Commits:

  2. # git reset commit_id
    git reset abc123
    This command reverts commits up to the abc123 commit ID. By default, git reset performs a 'soft reset,' meaning it reverts commits without modifying files in the working directory.
  3. Reverting Files:

  4. # git reset --hard commit_id
    git reset --hard abc123
    This command reverts commits up to the specified commit and also modifies the files in the working directory. This operation is irreversible, so it should be used with caution.
  5. Reverting Commits with a Soft Reset:

  6. # git reset --soft commit_id
    git reset --soft abc123
    This command reverts commits without altering the files in the working directory. It's useful when you want to undo commits but retain the changes in your files.
  7. Mixed Reset to Revert Commits and Staging Area (Default):

  8. # git reset --mixed commit_id
    git reset abc123
    This command reverts the commits and modifies the files but clears the Staging Area.
  9. Reverting to the Previous Commit:

  10. git reset --hard HEAD^
    This command reverts to the previous commit.
git revert
    The git revert command allows you to undo changes from one or more commits by creating a new commit. This method undoes changes without altering the commit history, providing a reversible mechanism for reverting changes. Here are the basic uses and examples of the git revert command:
  1. Reverting a Specific Commit:

  2. # git revert commit_id
    git revert abc123
    This command reverts the changes made in the abc123 commit and creates a new commit.
  3. Reverting Multiple Commits:

  4. # git revert commit_id1 commit_id2
    git revert abc123 def456
    This reverts the changes from both commits abc123 and def456 and creates separate commits for each revert operation.
  5. Adding a description to the revert commit:

  6. While performing a revert operation, you can add a description to the new commit using the -m or --mainline option. This specifies which parent branch to revert when dealing with a merge commit

    # git revert -m 1 commit_id
    git revert -m 1 abc123
git restore
    The git restore command is used to restore files or changes in the working directory or revert them to a specific commit state. Introduced in Git version 2.23, it serves as a replacement for the git reset and git checkout commands. Here are the basic usages and examples of the git restore command:
  1. Restoring Files in the Working Directory:

  2. # git restore file_name
    git restore index.html
    This command restores changes in the index.html file from the working directory.
  3. Reverting to a Specific Commit State:

  4. # git restore --source=commit_id --staged --worktree file_name
    git restore --source=abc123 --staged --worktree index.html
    This command reverts the changes of a specific file in the working directory and Staging Area to the state of the commit_id commit.
  5. Undo All Changes:

  6. git restore --source=commit_id --staged --worktree --source=commit_id .
    This command reverts the changes of all files in the working directory and Staging Area to the state of the commit_id commit.
  7. Cancel changes in the working directory:

  8. # git restore --source=HEAD --worktree file_name
    git restore --source=HEAD --worktree index.html
    This command cancels the changes in a specific file in the working directory.
  9. Reverting Files to a Specific Commit State:

  10. git restore --source=commit_id --staged --worktree --source=commit_id file_name
    This command reverts the changes of a specific file in the working directory and Staging Area to a particular commit state.
  11. Revert All Changes:

  12. git restore --source=commit_id --staged --worktree --source=commit_id .
    This command reverts the changes of all files in the working directory and Staging Area to a particular commit state.

09 Synchronizing Repositories

git remote
    The git remote command is used to manage remote repositories, which are often centralized locations where the project is stored or shared. This command allows you to view, add, remove, and modify remote repositories. Below are the basic uses and examples of the git remote command:
  1. Listing Remote Repositories:

  2. git remote
    This command lists the names of the remote repositories defined in your project.
  3. Listing Remote Repositories in More Detail:

  4. git remote -v
    This command lists the names and connection URLs of the remote repositories in more detail.
  5. Adding a Remote Repository:

  6. # git remote add remote_repo_name remote_repo_url
    git remote add origin https://github.com/username/project.git
    This command adds a new remote repository. origin typically represents the main repository address of the project.
  7. Updating a Remote Repository Name:

  8. # git remote rename old_name new_name
    git remote rename upstream origin
    This command changes the name of a remote repository.
  9. Removing a Remote Repository Name:

  10. # git remote remove remote_repo_name
    git remote remove origin
    This command removes the specified remote repository from the project.
  11. Displaying a Remote Repository Name or URL:

  12. # git remote show remote_repo_name
    git remote show origin
    This command displays detailed information about the specified remote repository, such as which branches it is tracking.
  13. Updating the URL of a Remote Repository:

  14. # git remote set-url remote_repo_name new_url
    git remote set-url origin https://new-address.com/username/project.git
    This command sets a new URL for the specified remote repository.

About

This repository contains detailed information about using Git and GitHub. It explains the basic concepts, terminology, and usage of Git. It also provides information on how to use the GitHub platform.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published