Our Trainings
Github-Git
06 January 2022
By UpDev
INSTALL GIT
GitHub provides desktop clients which include a graphical interface for the most common manipulations and an "an automatically updating command line edition of Git" for the advanced scenarios.
GitHub for Windows : https://windows.github.com
GitHub for Mac : https://mac.github.com
Les distributions de Git pour Linux et les systèmes POSIX sont disponibles sur le site web officiel de Git SCM.
Git for all platforms : https://git-scm.com
TOOL CONFIGURATION
Configure user information for all local repositories
$ git config --global user.name "[nom]" Defines the name you want to associate with all your commit operations
$ git config --global color.ui auto Enable colorization of command line output
CREATE DEPOSITS
Start a new repository or get one from an existing URL
$ git init [nom-du-projet] Create a local repository from the specified name
$ git clone [url] Downloads a project and all its version history
MAKE CHANGES
View changes and perform a commit operation
$ git status List all new and modified files to commit
$ git add[fichier] Adds a snapshot of the file, in preparation for version tracking
$ git reset [fichier] Remove the file from the index, but keep its contents
$ git diff Shows file changes that are not yet indexed
$ git diff --staged Shows the file differences between the indexed version and the latest version
$ git commit -m "[message descriptif]" Saves file snapshots permanently in version history
GROUP CHANGES Name a series of commits and combine the results of completed jobs
$ branch List all local branches in the current repository
$ git branch [nom-de-branche] Create a new branch
$ git branch [nom-de-branche] Create a new branch
$ git checkout [nom-de-branche] Switch to the specified branch and update the working directory
$ git merge [nom-de-branche] Combines the history of the specified branch in the current branch
$ git branch -d [nom-de-branche] Delete the specified branch
For comments: https://updevcommunity.com/app/post/github-git