Javascript required
Skip to content Skip to sidebar Skip to footer

Install Software Downloaded From Git Package Windows Updated FREE

Install Software Downloaded From Git Package Windows

How to install and employ Git on Windows

Updated: 06/xxx/2020 by Computer Hope

Git on Windows

Past default, Git is installed on Linux and macOS computers equally a command line pick. However, Microsoft Windows does not include a Git control. Beneath are the steps on how to install and use Git and GitHub on Microsoft Windows.

Installing Git on Windows

  1. Open the Git website.
  2. Click the Download link to download Git. The download should automatically beginning.
  3. Once downloaded, start the installation from the browser or the download folder.
  4. In the Select Components window, leave all default options checked and cheque any other additional components you want installed.
  5. Next, in the Choosing the default editor, used by Git unless you're familiar with Vim nosotros highly recommend using a text editor you're comfortable using. If Notepad++ is installed, we advise using it as your editor. If Notepad++ is non installed, you can abolish the install and install Notepad++ and and then restart the GitHub install.
  6. Side by side, in the Adjusting your PATH environment, we recommend keeping the default Utilise Git from the command line and too from 3rd-party software as shown below. This pick allows you to use Git from either Git Bash or the Windows Command Prompt.

Git install adjust path

  1. Next, we recommend leaving the default selected every bit Use OpenSSH.
  2. Adjacent, in Choosing HTTPS transport backend, exit the default Utilize the OpenSSL library selected.
  3. In the Configuring the line ending conversions, select Checkout Windows-style, commit Unix-way line endings unless you need other line endings for your piece of work.
  4. In the Configuring the terminal emulator to use with Git Fustigate window, select Apply MinTTY (the default terminal of MSYS2).
  5. On the Configuring actress options window, leave the default options checked unless you need symbolic links.
  6. Click the Install button
  7. Once completed, yous can check the selection to Launch Git Bash if you desire to open a Fustigate command line or, if you selected the Windows command line, run Git from the Windows command line.

Tip

Nosotros highly recommend you use Git from the control line and not use a GUI interface. You'll merely be using the control line to interface with Git to manage the files. Editing can all the same be done through a text editor or IDE of your choice. If you're new to the control line, you lot can find assist with navigating the Windows command line and Linux (Bash) through the links below.

  • How to use the Windows control line (DOS).
  • Linux beat tutorial.

Configuring and connecting to a remote repository

In our example, we're using GitHub as a storage for our remote repository. Below are the steps on how you can connect to a GitHub repository. If you are new to GitHub, run across: How to create a GitHub repository.

  1. From the command line, move to the directory yous desire to contain your Git repository.
  • How to change a directory or open a binder.
  1. Type the following command to configure your Git username, where <your proper name> will be your GitHub username.
git config --global user.name "<your name>"
  1. After entering the above control, you lot'll be returned to the command prompt. Side by side, enter your e-mail address past typing the following command, where <your east-mail service> is your e-postal service address.
git config --global user.email "<your e-mail>"
  1. One time the above steps are completed, you'll exist set to connect to a remote repository. To find the repository accost, become to a repository on GitHub and click the Clone or download repository link to get the address. For instance, we've created a repository chosen "example" at https://github.com/Computerhope/example.git address. Copy the address to your clipboard.
  2. Once copied go back to the control line and type the post-obit command, where <URL> is the accost yous copied. To paste that address into the command line correct-click in the command line window and click paste.
git clone <URL>
  1. In one case the Git repository is created, you'll have a new directory in your current directory with the name of the Git repository.
  2. One time the Git remote repository is cloned to your local repository, a new folder in the current directory should appear with the name of the Git repository. For example, in our "case" Git we would have a new directory called "example". Employ the cd command to change into the new directory.
  3. Once in the new directory, blazon the following control to list the remote repositories.
git remote
  1. If successful, the output is "origin," which is a special name that refers to the remote repository.
  2. To meet the aliases (URL or path), type the post-obit command.
git remote -v

Running each of the above commands requite you an output similar to what is shown in our example below.

Git listing remote repositories

Now that you lot've connected to a remote repository on GitHub you're ready to offset working on the files and pushing and pulling files equally you update the files.

Working in your local repository and pushing files

After following the above steps and cloning a remote repository, you lot tin work on the files every bit y'all normally would. Yous can create new files or edit existing files from the command line or your favorite text editor. Below, are the steps of creating a new file, pushing that file, editing an existing file, and pushing the update.

Creating a new file and pushing to remote repository

  1. Create a new file in the Git directory by typing the following command from either the Bash or Windows command line. The following control opens and creates a file called example.txt in Notepad. In Git Bash, you could likewise use the touch command to create a blank new file and then type "offset <name of file>" to open the file in your favorite text editor.
beginning notepad example.txt
  1. In the text editor, enter some text into the file and relieve and exit the file.
  2. Back at the command line blazon the following control to become the current condition of your branch and untracked files.
git status
  1. Git displays a window similar to the case shown below, showing that the file we created is new and untracked by Git.

Git status

  1. We'll now want to add together this file to Git to be tracked by typing the following command. If your file is not named "example.txt," y'all'd want to change the text to the name of your file.
git add together case.txt
  1. Afterwards inbound the in a higher place command, the file is added equally a new file also known as staging. Typing git status again shows you in light-green that the file is a new file that is set up to be committed.
  2. Next, type the following command to commit the changes made in the local workspace to the local repository. In the example below, our notes "First instance" should exist notes that would make sense everyone working on your project.
git commit -m "First case"

Note

You can also type git commit with no additional tags or options. However, when doing this information technology opens a vim like editor that can be difficult for those not familiar with the vim to use. If you lot blazon this command press "i" to enter insert mode and blazon the notes for the commit on the first line, press Esc, and so type ":wq" to save, exit, and commit. We propose using the above command because it's easier for more people to use.

  1. Finally, now that changes are moved from your workspace into your local repository it's ready to be pushed to the remote repository. Type the following control to push button all changes to the remote repository.

Tip

If yous want to follow the progress, you can blazon git status again to see the current status. You can besides type git log to encounter a log of changes.

git push

Note

Y'all'll be asked for your GitHub username and password if your computer has not logged in to Git from the control line.

Once the file is pushed, it appears in your GitHub remote repository and is available to everyone else who're working with the same repository.

Modifying a file and pushing to remote repository

  1. Edit and modify ane or more files in your Git.
  2. Blazon git status to meet the condition of all the files non nevertheless committed from the workspace to the local repository.
  3. Blazon the following command to add together all files. The unmarried period indicates that you want all files to be added to the local repository. Some people may also use git add -A to add all.

Tip

You tin too employ wildcards instead of a period. For example, if you wanted to add all text files you could blazon *.txt instead of a unmarried period to simply add text files.

git add .
  1. In one case the files are added, type the post-obit command to commit. Alter the notes to apply to your commit.
git commit -thou "Second update"
  1. Finally, type git button to button the commit to the remote repository.

Tip

If you lot're working with a lot of other people, we'd recommend you pull (explained below) before committing. If your local repository is not the aforementioned every bit the remote repository (excluding your new changes), the commit fails. For example, if someone has added new files to the remote repository while you've been working and yous try commit, it fails until y'all pull.

Pulling or fetching updates from the remote repository

If it's been awhile since you lot've committed any work, perform the git pull command to go the latest updates from the remote repository and merge them into your local repository. By pulling updates from a repository before committing, it verifies your local repository and the remote repository are the same and prevents merge conflicts.

To get all changes without merging, run the git fetch command to grab all of the latest updates from the remote repository without merging changes.

How to deal with a Git merge conflict

When multiple people are working with the same files, yous're going to encounter merge conflicts. When a conflict occurs, Git modifies your local files and it is up to you to manually fix the files with the conflicts.

Tip

Utilize the git status command to encounter the condition and merge disharmonize information.

Open the file with the conflict to commencement correcting the errors. In the case file beneath, nosotros had a text file with one line of text and in the local repository we added the text "update1" to the file. Yet, during the aforementioned fourth dimension, the remote repository file was modified and added "update2" to the file on the same line. Git marks conflicts with "<<<<<<< Head" for lines in the current branch and everything later "=======" as the remote changes followed by ">>>>>>> < hash >" to marking the end.

Some other file that is uploaded in-between pulls. <<<<<<< Head update1 ======= update2 >>>>>>> 62ee0eeba2e5b94d10574c1a6a68216e9b392e4c

To resolve this merge conflict, we would need to decide what text we wanted to keep, update, or remove. In this case, nosotros desire to keep "update1" and "update2" in the society they're listed so nosotros would but need to remove the Git markings to brand the file resemble the post-obit example.

Another file that is uploaded in-betwixt pulls. update1 update2

Note

If yous're working with a big file, it's a good thought to search the file for "HEAD" considering there may be more than than one conflict.

Once the changes are fabricated in the file, we could save the file and then perform the following git commands to update the fixes.

git add .
git commit -yard "Stock-still the merge conflict"
git push origin primary

The example given in this merge disharmonize is a very bones example. When dealing with a file with more than a few lines of text or large sections of code, merge conflict can become a lot more confusing. To brand it easier to deal with merge conflicts, you can use the command git mergetool to use a merge tool, such as WinMerge or some other popular merge tool.

Creating a Git co-operative

Creating a co-operative allows you to create a duplicate of the master (trunk) and make several updates without affecting the master. For example, when developing a plan if a big fix was demand that could take weeks or months, a branch could be created for that set up. Once you've stock-still the bug, you could merge your branch back into the master.

To create a branch in your local repository, follow the steps beneath.

  1. In the Git master directory, type the post-obit command, where "<New Branch>" is the proper name of the new co-operative name. For instance, we could telephone call the branch "examplebranch".
git branch <New Branch>
  1. Next, type the following control to switch to the co-operative.
git checkout <Branch Name>
  1. After entering the above command, the prompt (in Git Bash) changes from "master" to the branch name to betoken yous're working in a branch.
  2. From this point, you tin can continue to use Git and modify the files how you have in the past.
  3. To come across all available branches, yous can use the git branch control. For example, typing git branch displays your local repository branches. Typing git branch -a displays all local and remote repositories.
  4. If you need to push the co-operative to the remote repository, you tin can run the following command.
git push button --set-upstream origin <Co-operative Proper noun>
  1. Finally, if you need to switch back to the principal co-operative, you can type the post-obit control.
git checkout master

How to merge a co-operative back into the master

After completing your piece of work, y'all'll want to merge it back into the master or another co-operative by following the steps below.

  1. Motion into the branch you desire to merge into. For example, if you wanted to merge back into the main, type the following control.
git checkout master
  1. Once in the master, type the post-obit command to merge the branch.
git merge <Branch Name>
  1. Once the merge is performed, add the files.
  2. Next, commit the changes.
  3. Once merged and committed, button the merge past typing the following command. If you lot get conflicts during the merge, see our how to bargain with merge conflicts department.
git push

How to delete a local and remote branch

If, after merging a branch you no longer want to keep the local or remote branch, you can perform the following commands.

To delete the local branch, type the post-obit command.

git branch -d <Branch Proper noun>

To delete the remote branch, type the following command.

git push origin --delete <Branch Name>

Install Software Downloaded From Git Package Windows

DOWNLOAD HERE

Source: https://www.computerhope.com/issues/ch001927.htm

Posted by: coppocktric1942.blogspot.com