This content originally appeared on DEV Community and was authored by Mansoor Ahmed
Installation of Git on computers has become incredibly easy in recent times. There are one-click installers for both Mac and Windows.
Installing Git on Windows
On Windows, we will download the “Git for Windows” package from here:
https://git-for-windows.github.io/
When running the installer EXE, you ought to choose the default options on each screen. After finishing the installation, you’ll begin working with Git by starting the “Git Bash” application. You‘ll find it within the Windows START menu, inside the “Git” folder: Installing Git on Mac OS On Mac OS X, a one-click installer package is out there which will be downloaded from here: https://sourceforge.net/projects/git-osx-installer/ Once this is often installed, we will jump right into Git by starting the “Terminal. app” on our Mac. We‘ll find this within the “Utilities” subfolder of our “Applications” folder in Finder:
Configuring Git
A couple of very basic configurations should be made before we start. We should always set our name and email address also as enable coloring to doll up command outputs:
$ git config –global user.the name “John Doe”
$ git config –global user.email “john@doe.org”
$ git config –global color.ui auto
The Basic Workflow of Version Control
Before we stray in Git commands, we ought to understand what a basic workflow with version control seems like. We‘ll rehearse each step intimately later during this book. But first, let‘s get an understanding of what the workflow, generally, is like. the foremost basic building block of version control may be a “repository”.
Getting such a repository on our local machine is often wiped out in two ways: If we have a project locally on our computer that’s not yet under version control, we will initialize a replacement repository for this project. If we‘re aged board a project that‘s already running, the likelihood is that there’s a repository on a foreign server (on the web or on our local network). We‘ll then probably be given a URL to the present repository that we’ll then “clone” (download/copy) to our local computer.
As soon as we’ve got an area repository, we’ll start performing on our files: modify, delete, add, copy, rename, or move files in whatever application (our favorite editor, a file browser, …) we favor . during this step, we don‘t have to be careful with love or money. Just make any changes necessary to maneuver our project forward.
It‘s only you are feeling you‘ve reached an interesting state that we’ve to think about version control again. Then it‘s time to conclude our changes during a commit.
However, before we commit, we‘ll want to urge a summary of what we‘ve changed thus far. In Git, we‘ll use the “status” command to urge an inventory of all the changes we performed since the last commit: which files did we change? Did we create any new ones or delete some old ones?
Next, we tell Git which of our local changes we would like to conclude within the next commit. Only because a file was changed doesn‘t mean it’ll be a part of a subsequent commit! Instead, we’ve to explicitly decide which changes we want to incorporate. to try to do this, we add them to the so-called “Staging Area”.
Now, having added some changes to the area, it‘s time to truly commit these changes. We‘ll need to add a brief and meaningful message that describes what you really did. The commit will then be recorded in our local Git repository, marking a replacement version of your project.
From time to time, we‘ll want to possess a glance at what happened within the project – especially if we‘re working alongside people. The “log” command lists all the commits that were saved in chronological order. This allows us to ascertain which changes were made intimately and helps us comprehend how the project evolved.
Also when collaborating with others, we‘ll both want to share (some of) our changes with them and receive the changes they made. a foreign repository on a server is employed to form this exchange possible.
For more details visit:https://www.technologiesinindustry4.com/2021/05/how-to-install-configure-git-on-computerhtml
This content originally appeared on DEV Community and was authored by Mansoor Ahmed
Mansoor Ahmed | Sciencx (2021-09-07T18:32:44+00:00) How To Install & Configure Git On Computer?. Retrieved from https://www.scien.cx/2021/09/07/how-to-install-configure-git-on-computer/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.