GIT is a distributed version control system that facilitates Mia-Platform activities. This vademecum summarizes the main GIT commands and guidelines to simplify your work.
Start using Git by installing it on your PC
Configure valid user information for all repositories.
Set the username (name.surname) you want to show on your commits.
Set up the business email you want to show on your commits.
We recommend a series of configurations that could help you in your work.
Set fetch.prune as active. It allows you to keep branches aligned remotely with your local branches.
Set the automatic rebase to the pull. It allows you to avoid unnecessary merge on a branch if you work in more than one person on the same branch.
Set the autostash to true in the initial configurations. Combined with the previous configuration, it allows you to perform a pull even with unscheduled modifications.
Color your GIT for a better view of the history.
Create a repository
Start with a new repository or download information from an existing URL.
Create a new local repository with its specific name.
Download a project and its entire chronology.
Review changes to the code and prepare a commit.
List all files, new or modified, to be committed.
Shows the differences between the files that were added and not ignored in the staging area.
Add new files and prepare them for the commit.
Show file differences between staging and last modification.
Remove a file from the staging area, but keep the changes.
Add the file to the local repository header.
Upload all local branches to the remote repository.
Manage the branch
Name your commits and join them when you finish.
Lists all branches in the current repository.
Create a new branch.
Switch to the specified branch and update the current directory.
Merge the history of the specified branch with the current one.
Delete the specified branch only if it has been merged to master.
Make refactoring your files
Search and remove files from the history.
Remove a file from the directory and prepare for permanent deletion.
Delete the file from GIT, but keep the local file.
Remove your files from the history
Exclude files and temporary locations.
A text file called .gitignore prevents accidental versioning of files or directories according to a specified pattern.
List all files ignored in this project.
Save all changes
Archive and restore incomplete changes. Useful for remotely downloading changes while you are working and you do not want to commit and push again or to change from one branch to another without committing before.
Temporarily store all changed files so you can remotely git pull and download changes made by other team members.
Restore all files placed in stash from the stash archive. In this way you can merge with the changes downloaded remotely with the pull.
Lists the edited files stored in stash.
Delete files stored in stash.
Review the chronology
Browse and check the evolution of the files of each project.
View the commit history of the current branch.
View the history of a file, including changes.
Show the difference between two branches.
Show metadata and changes made for a specific commit.
Eliminates errors and alters changes history.
Cancel all commits made after [commit], preserving local changes.
Delete all history and changes until the specified commit.
Connect to a remote URL and get change history.
Download the change history from the remote repository.
Join the remote branch with the local branch.
Upload all changes to the local branch on the remote repository.
Update your local repository with the online repository.