NEWS COMMUNITY STORE LABS GIT SIGN UP LOGIN LOGOUT ROKOJORI NEWSLETTER SIGN UP LOGIN LOGOUT NEWS COMMUNITY STORE LABS GIT TOGGLE FULLSCREEN VOLLBILD AN/AUS image/svg+xml image/svg+xml image/svg+xml GIT GUIDE
Most needed commands for git
image/svg+xml image/svg+xml Most needed commands for git image/svg+xml
Show instructions for:

FETCH: Update online history GIT-GUI 📌 Remote ▸ Fetch from ▸ 🖱️ Click: origin CMD/TERMINAL git fetch STATUS: What is going on? GIT-GUI 🗔 Message Window ▸ 🖱️ Click: Rescan CMD/TERMINAL git status ADD: Mark files for saving GIT-GUI 🗔 Message Window ▸ 🖱️ Click: Stage Changed CMD/TERMINAL git add . COMMIT: Save snapshot GIT-GUI 🗔 Message Window ▸ 💬 Commit Message ▸ ⌨️ Type: {Snap Shot Name}

🗔 Message Window ▸ 🖱️ Click: Commit
CMD/TERMINAL git commit -m "{Snap Shot Name}"
PUSH: Upload/share local history GIT-GUI 🗔 Message Window ▸ 🖱️ Click: Push

🗔 Push Window ▸ 🖱️ Select: {BRANCHNAME} 🖱️ Click: Push
CMD/TERMINAL git push
BRANCH: Create branch GIT-GUI 📌 Branch ▸ 🖱️ Click: Create...

🗔 Create Branch Window ▸ Branch Name ▸ Name ▸ ⌨️ Type: {BRANCHNAME}

🗔 Create Branch Window ▸ Starting Revision ▸ 🖱️ Select: Tracking Branch List of names ▸ 🖱️ Select: {REMOTE-BRANCH-BASE}

🗔 Create Branch Window ▸ Options ▸ Update existing branch ▸ 🖱️ Select: No
🖱️ Check: ✓ Fetch Tracking Branch
🖱️ Check: ✓ Checkout After Creation
CMD/TERMINAL git branch {BRANCHNAME} {OPTIONAL-BASE-BRANCH} git checkout {BRANCHNAME}
CHECKOUT: Switch branch GIT-GUI 📌 Branch ▸ 🖱️ Click: Checkout...

🗔 Checkout Window ▸ 🖱️ Select: Local Branch/Tracking Branch 🖱️ Select: {BRANCHNAME} 🖱️ Click: Checkout
CMD/TERMINAL git checkout {BRANCHNAME}
PULL: Download and merge with local GIT-GUI 📌 Remote ▸ Fetch from ▸ 🖱️ Click: origin

📌 Branch ▸ 🖱️ Click: Checkout...

🗔 Checkout Window ▸ 🖱️ Select: Tracking Branch 🖱️ Select: {BRANCHNAME} 🖱️ Click: Checkout
CMD/TERMINAL git pull
MERGE: Merge branches GIT-GUI 📌 Merge ▸ Local Merge... ▸

🗔 Merge Window ▸ 🖱️ Select: Tracking Branch 🖱️ Select: {BRANCHNAME} 🖱️ Click: Merge
CMD/TERMINAL git merge {BRANCHNAME}
MERGE: Check conflicts before merging GIT-GUI 📌 Merge ▸ Local Merge... ▸

🗔 Merge Window ▸ 🖱️ Select: Tracking Branch 🖱️ Select: {BRANCHNAME} 🖱️ Click: Visualize
CMD/TERMINAL git merge --no-commit --no-ff {BRANCHNAME} git merge abort
DIFF: Show merge conflicts GIT-GUI Conflicts can be viewed per file in the left list. CMD/TERMINAL git diff --name-only --diff-filter=U --relative
::/_graphics/labs/git-logo-wide.svg image/svg+xml image/svg+xml image/svg+xml fetch fetch Official documentation: git fetch Always safe to use Overview CMD/TERMINAL EXAMPLE git fetch WHAT IT DOES Downloads and updates the project history with all it branches and snap shots from the server into a hidden directory. It does not change the files of the local active state
WHEN TO USE Everytime before you want to download the current states of any branches or snapshots and also when you want to upload something. Makes also sense before using git status.
fetch fetch Official documentation: git fetch Always safe to use Overview CMD/TERMINAL EXAMPLE git fetch WHAT IT DOES Downloads and updates the project history with all it branches and snap shots from the server into a hidden directory. It does not change the files of the local active state
WHEN TO USE Everytime before you want to download the current states of any branches or snapshots and also when you want to upload something. Makes also sense before using git status.
::/_graphics/labs/git-logo-wide.svg image/svg+xml image/svg+xml image/svg+xml status status Official documentation: git status Always safe to use Overview CMD/TERMINAL EXAMPLE git status WHAT IT DOES Gives the name about the current local branch and its snapshot and its relation to its online pendant: Are they different and is one more up to date?
It also list all files that changed (untracked) and the changed files that are picked to be included (staged) for the next snap shot (commit)
WHEN TO USE Everytime you want to know something about the current branch, either to see which local changes exists to the snapshot it is based on or its relation to the online version.
status status Official documentation: git status Always safe to use Overview CMD/TERMINAL EXAMPLE git status WHAT IT DOES Gives the name about the current local branch and its snapshot and its relation to its online pendant: Are they different and is one more up to date?
It also list all files that changed (untracked) and the changed files that are picked to be included (staged) for the next snap shot (commit)
WHEN TO USE Everytime you want to know something about the current branch, either to see which local changes exists to the snapshot it is based on or its relation to the online version.
::/_graphics/labs/git-logo-wide.svg image/svg+xml image/svg+xml image/svg+xml add add Official documentation: git add Caution: Use only before saving Overview CMD/TERMINAL EXAMPLE git add . git add "{path/to/something}" WHAT IT DOES Depending on the current working directory of the CMD/terminal it will mark all changed files of the path and mark them - they are staged. These marked files will be included in the next snapshot (commit). Using only a dot takes all files from the current working directory. WHEN TO USE Before you want to save/create a snapshot (commit). You can see which files are marked as staged with git status. add add Official documentation: git add Caution: Use only before saving Overview CMD/TERMINAL EXAMPLE git add . git add "{path/to/something}" WHAT IT DOES Depending on the current working directory of the CMD/terminal it will mark all changed files of the path and mark them - they are staged. These marked files will be included in the next snapshot (commit). Using only a dot takes all files from the current working directory. WHEN TO USE Before you want to save/create a snapshot (commit). You can see which files are marked as staged with git status. ::/_graphics/labs/git-logo-wide.svg image/svg+xml image/svg+xml image/svg+xml commit commit Official documentation: git commit Caution: Use to save a snapshot Overview CMD/TERMINAL EXAMPLE git commit -m "{Snap Shot Name}" WHAT IT DOES Saves all marked files into a snapshot - a commit. WHEN TO USE If you want save to current state as logical unit. commit commit Official documentation: git commit Caution: Use to save a snapshot Overview CMD/TERMINAL EXAMPLE git commit -m "{Snap Shot Name}" WHAT IT DOES Saves all marked files into a snapshot - a commit. WHEN TO USE If you want save to current state as logical unit. ::/_graphics/labs/git-logo-wide.svg image/svg+xml image/svg+xml image/svg+xml push push Official documentation: git push Caution: Use only to upload Overview CMD/TERMINAL EXAMPLE git push WHAT IT DOES Uploads all snapshot (commits) to the server WHEN TO USE When you want to save your local snapshots online and want to share them with others. push push Official documentation: git push Caution: Use only to upload Overview CMD/TERMINAL EXAMPLE git push WHAT IT DOES Uploads all snapshot (commits) to the server WHEN TO USE When you want to save your local snapshots online and want to share them with others. ::/_graphics/labs/git-logo-wide.svg image/svg+xml image/svg+xml image/svg+xml BRANCH BRANCH Official documentation: git branch Caution: Use only without pending changes Overview CMD/TERMINAL EXAMPLE git branch {BRANCHNAME} git checkout {BRANCHNAME} WHAT IT DOES This creates a new branch and switches to it with the second command. WHEN TO USE If you want to create a new branch. It could be for developing, testing things out or for saving stuff, that is not used in the other branches yet. BRANCH BRANCH Official documentation: git branch Caution: Use only without pending changes Overview CMD/TERMINAL EXAMPLE git branch {BRANCHNAME} git checkout {BRANCHNAME} WHAT IT DOES This creates a new branch and switches to it with the second command. WHEN TO USE If you want to create a new branch. It could be for developing, testing things out or for saving stuff, that is not used in the other branches yet. ::/_graphics/labs/git-logo-wide.svg image/svg+xml image/svg+xml image/svg+xml checkout checkout Official documentation: git checkout Caution: Use only without pending changes Overview CMD/TERMINAL EXAMPLE git checkout {BRANCHNAME} WHAT IT DOES Adds and remove files from the current state to match the most current state (commit) of the "checked out" branch. WHEN TO USE When you want to switch the history branch of the project - to see another version with different features or workstates of others. checkout checkout Official documentation: git checkout Caution: Use only without pending changes Overview CMD/TERMINAL EXAMPLE git checkout {BRANCHNAME} WHAT IT DOES Adds and remove files from the current state to match the most current state (commit) of the "checked out" branch. WHEN TO USE When you want to switch the history branch of the project - to see another version with different features or workstates of others. ::/_graphics/labs/git-logo-wide.svg image/svg+xml image/svg+xml image/svg+xml pull pull Official documentation: git pull Caution: Use only without pending changes Overview CMD/TERMINAL EXAMPLE git pull WHAT IT DOES Downloads the online history and add/remove files to match the recent online state (commit) of the current branch. WHEN TO USE When you want to update to the latest state of a branch. pull pull Official documentation: git pull Caution: Use only without pending changes Overview CMD/TERMINAL EXAMPLE git pull WHAT IT DOES Downloads the online history and add/remove files to match the recent online state (commit) of the current branch. WHEN TO USE When you want to update to the latest state of a branch. ::/_graphics/labs/git-logo-wide.svg image/svg+xml image/svg+xml image/svg+xml merge merge Official documentation: git merge Caution: Use only without pending changes Overview CMD/TERMINAL EXAMPLE git merge {BRANCHNAME} WHAT IT DOES It adds, changes, and removes files to combine the newest versions of the current branch and the merging branch. If there are files that have new seperate changes in both branches a merge conflict arises. Merge conflicts are sometimes resolved automatically, but should be double checked manually. WHEN TO USE When you want to combine two (or multiple) project states into one that contains all states. merge merge Official documentation: git merge Caution: Use only without pending changes Overview CMD/TERMINAL EXAMPLE git merge {BRANCHNAME} WHAT IT DOES It adds, changes, and removes files to combine the newest versions of the current branch and the merging branch. If there are files that have new seperate changes in both branches a merge conflict arises. Merge conflicts are sometimes resolved automatically, but should be double checked manually. WHEN TO USE When you want to combine two (or multiple) project states into one that contains all states. ::/_graphics/labs/git-logo-wide.svg image/svg+xml image/svg+xml image/svg+xml merge (to see conflicts) merge (to see conflicts) On Code Maven Official documentation: git merge Caution: Use only without pending changes, save before Overview CMD/TERMINAL EXAMPLE git merge --no-commit --no-ff {BRANCHNAME} git merge abort WHAT IT DOES It is similar to the normal merge, but it is easier to revert it by calling . WHEN TO USE When you think there could be some conflicts and you want to see them before. merge (to see conflicts) merge (to see conflicts) On Code Maven Official documentation: git merge Caution: Use only without pending changes, save before Overview CMD/TERMINAL EXAMPLE git merge --no-commit --no-ff {BRANCHNAME} git merge abort WHAT IT DOES It is similar to the normal merge, but it is easier to revert it by calling . WHEN TO USE When you think there could be some conflicts and you want to see them before. ::/_graphics/labs/git-logo-wide.svg image/svg+xml image/svg+xml image/svg+xml diff (see unmerged) diff (see unmerged) Official documentation: git diff Overview CMD/TERMINAL EXAMPLE git diff --name-only --diff-filter=U --relative WHAT IT DOES It outputs the names of all unmerged files of the current working states. WHEN TO USE When you merged two brances and want to know which files are still not resolved/merged. diff (see unmerged) diff (see unmerged) Official documentation: git diff Overview CMD/TERMINAL EXAMPLE git diff --name-only --diff-filter=U --relative WHAT IT DOES It outputs the names of all unmerged files of the current working states. WHEN TO USE When you merged two brances and want to know which files are still not resolved/merged. TO GIT OVERVIEW











All social media brands are registrated trademarks and belong to their respective owners.





CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
We are using cookies on this site. Read more... Wir benutzen Cookies auf dieser Seite. Mehr lesen...