Difference between revisions of "Git"

From no name for this wiki
Jump to: navigation, search
Line 35: Line 35:
 
git stash pop
 
git stash pop
 
</pre>
 
</pre>
 +
 +
== merege ==
 +
 +
<pre>
 +
git merge <branch_to_merge_into_current>
 +
git status
 +
</pre>
 +
 +
Merge auflösen.
 +
<pre>
 +
<<<<<<< HEAD
 +
this is some content to mess with
 +
content to append
 +
=======
 +
totally different content to merge later
 +
>>>>>>> new_branch_to_merge_later
 +
</pre>
 +
 +
<pre>
 +
final text
 +
</pre>
 +
 +
<pre>
 +
git add conficted.txt
 +
git commit -m "blabal"
 +
</pre>
 +
 +
  
 
== rebase ==
 
== rebase ==

Revision as of 15:10, 10 February 2019

switch branch

git checkout -b <branch>

Mit der b Option wird ein neuer Branch kreiert.

branch löschen

git checkout -d <branch>

fetch und pull

git fetch origin

git fetch really only downloads new data from a remote repository - but it doesn't integrate any of this new data into your working files.

git pull origin master

git pull, in contrast, is used with a different goal in mind: to update your current HEAD branch with the latest changes from the remote server.

set remote url

git remote set-url origin https://github.com/username/repo

stash

git stash
git stash list

Speichert alle Änderungen und macht ein undo changes. Diese können später wieder aktiviert werden:

git stash pop

merege

git merge <branch_to_merge_into_current>
git status

Merge auflösen.

<<<<<<< HEAD
this is some content to mess with
content to append
=======
totally different content to merge later
>>>>>>> new_branch_to_merge_later
final text
git add conficted.txt
git commit -m "blabal" 


rebase