Command | Description |
---|---|
git status |
Shows the state of the local repository (changes, commits, ...) |
git clone <repo_url> |
Creates a folder and copies the remote repository to it. |
git branch |
Shows the local branches and the active one. |
git branch <name> |
Creates a new local branch. |
git checkout <branch> |
If the local branch exists: update the files to the state of the branch. If not, creates a local branch. |
git add . |
Stages all the local changes (except for files and folders in the .gitignore) |
git stash |
Resets the un-staged changes but stores them in a stash. |
git commit -m "commit description" |
Creates a commit with all the staged changes. |
git push |
Sends all the local commits to the remote repository. |
git push -o ci.skip |
Push without triggering the pipeline. |
git pull |
Downloads the last changes of the remote repository to the local one. Tries to merge the changes with the local changes. Can create Merge Conflicts. |
git merge <branch> |
Pulls the content of the specified branch into the active branch. |
git clone --recurse-submodules <repo_url> |
Also clone all the sub-modules. |
git submodule add <remote_url> <destination_folder> |
Adds another repository as sub-module. |
git submodule update --init --recursive |
For an already cloned project: clones the sub-modules. |
git submodule update --remote --merge |
Update the sub-modules (pulls to the correct commits). |
Comments
Please register or sign in to add a comment.