# Git --- ## Clone a repository Copy an existing remote repository to your local machine. ```shell git clone ``` Example: ```shell git clone https://github.com/user/repo.git ``` --- ## Pull changes from remote Fetch and merge changes from a remote repository to your local branch. ```shell git pull ``` Example: ```shell git pull origin main ``` --- ## Push changes to remote Upload local commits to a remote repository. ```shell git push ``` Example: ```shell git push origin main ``` --- ## Rebase branches Reapply commits on top of another base tip. ```shell git rebase ``` Example: ```shell git rebase main ``` --- ## Initialize a new repository Create a new Git repository in the current directory. ```shell git init ``` --- ## Manage remotes - **Add a remote:** ```shell git remote add ``` - **Set/Update remote URL:** ```shell git remote set-url ``` - **Remove a remote (e.g., origin):** ```shell git remote remove origin ``` --- ## Commit changes with GPG signature Sign your commit with a GPG key. ```shell git commit -S -m "Your commit message" ``` - `-S` → sign commit with GPG key - `-m` → commit message --- ## Notes - To check the configured remotes: ```shell git remote -v ``` - To see commit history: ```shell # Those options only add Styling, git log --oneline --graph --all --decorate # Plain Text Log, git log ``` - Stage changes before committing: ```shell git add git add . # stage all changes ``` ---