Version control is a task of keeping a software system that may consist of many versions and configurations that are well organized. Version control software keeps track of every modification to the code in a special kind of database. If an unwanted version of the code is sent to the Version Control System's database it keeps track of the previous version so that the change can be fixed or simply left out.
The advantages of this type of software are having the ability to have a team simultaneously work on a project together. Without software like version control, making large scale changes to your project could be risky if they break or if you can't always be in the same room as your team. Version control systems allow you to compare files, identify differences, and merge the changes if needed before committing any code.
Git is an open source project developed in 2005 by Linus Travolds, the creator of the Linux operating system. Git has proven the be the fastest and easiest to learn version control software out on the market with an almost scary number of commercial projects being done in collaboration with Git. Developers who have worked with Git have a leading level of prestige followed with their confidence in the ability of the program which is why it has risen to the status it does now in the developed world. Many versions of control systems can be used, some are free but the most commonly used is Git.
Init: "init" defined as initialize, sets up git to begin tracking changes to the project. Common practice is to follow up with the "git status" command to verify that indeed you are working within that directory and changes are being tracked.
Add: "git add" begins to add files to the staging area. There are multiple ways of using this tag. "git add filename-1.txt filename-2.txt" Here we are adding multiple files at once
Commit: this is the last step in the git workflow. A commit permanently stores changes from the staging area inside the repository. 1)prior to this you must add a mesage and to do so the command is "git commit -m "Here's the example". Here the "-m" stands for message. Your message should be within quotation marks, written in the present tense and within 50 characters.
Push: The git push command is used to upload local repository content to a remote repository. The git push is most commonly used to publish and upload local changes to a central repository. After a local repository has been modified a push is executed to share the modifications with remote team members.git add brncgit status 1)git push <remote> <branch>: Here you are pushing the specified barnch to <remote>. This creates a local brach in the destinantion repository. Git will prevent the push if it threatens overwriting commits in the desitination repository. 2)git push <remote> --force: Same as the above command but will force the push disregaring overwrites. 3)git push <remote> --all: Push all of your local branches to the specified remote. 4)git push <remote> --tags Push won't automatically send all of your tags along with the local branches. This command will send all tags to the remote repository.
Some of the power from this program comes from its intuitive commands within, some of most used for Git is "git init", "git add", "git commit", "git push". these commands start with the initialization of a git project, the "git init" does this making a new repository. To add code to a file such as HTML we can use the command "git add" this adds all modified and new files in the current directory to the staging area, hence preparing them for the next command. Next is the "git commit" input is used to save your changes to the local repository or Master file.
Git pull and fetch are use to download content from sources like Github. This tool is a remote repository or files safe for team projects, be it localized or remote.
A git branch is a lightweight moveable pointer to one of these commits. Branching allows the user to create a separate page away from the master to work on without affecting the master file. Branches are a local version of the master with new content inside them.
This command is git's way of piecing together your downloaded and revised version of the master branch with the newest version. the git merges command (git merge "branch name" and where "branch name") will tell the branch what is merging and where. In most cases, this is fairly linear