Adds informations on git commands

This commit is contained in:
vl4dd 2021-04-02 10:48:01 +02:00
parent 639e986b53
commit 6dd1bc9e10
2 changed files with 57 additions and 3 deletions

View File

@ -12,6 +12,7 @@
## Remote Execution ## Remote Execution
![Remote Execution](img/Remote_execution.png) ![Remote Execution](img/Remote_execution.png)
## Basic commands ## Basic commands
================= =================
@ -77,6 +78,62 @@ Date: Thu Apr 1 12:11:34 2021 +0200
First Commit First Commit
``` ```
## SHARE & UPDATE
### Retrieving updates from another repository and updating local repos
=================================
add a git URL as an alias
>git remote add [alias] [url]
fetch down all the branches from that Git remote
>git fetch [alias]
merge a remote branch into your current branch to bring it up to date
>git merge [alias]/[branch]
Transmit local branch commits to the remote repository branch
>git push [alias] [branch]
>git pull
fetch and merge any commits from the tracking remote branch
## BRANCH & MERGE
### Isolating work in branches, changing context, and integrating changes
![Remote Execution](img/Branching.png)
>git branch
list your branches. a * will appear next to the currently active branch
>git branch [branch-name]
create a new branch at the current commit
>git checkout
switch to another branch and check it out into your working directory
>git checkout -b|-B <new_branch> [<start point>]
Specifying -b causes a new branch to be created as if git-branch(1) were called and then checked out.
If -B is given, <new_branch> is created if it doesnt exist; otherwise, it is reset. This is the transactional equivalent of
>git merge [branch]
merge the specified branchs history into the current one
>git log
show all commits in the current branchs history
## TRACKING PATH CHANGES ## TRACKING PATH CHANGES
### Versioning file removes and path changes ### Versioning file removes and path changes
================================= =================================
@ -93,9 +150,6 @@ Show all commit logs with indication of any paths that moved
>git log --stat -M >git log --stat -M
## SHARE & UPDATE
### Retrieving updates from another repository and updating local repos
=================================
### History ### History
```bash ```bash

BIN
img/Branching.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB