Skip to content

Commit

Permalink
one small update
Browse files Browse the repository at this point in the history
  • Loading branch information
MukundVarmaT committed Feb 29, 2020
1 parent 10824a1 commit b4511bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Git--Notes
[Git Notes readme](git-notes.md)
# Git-Notes

- [Git command line notes](git-notes.md)


Thanks to @sreekarsr
19 changes: 4 additions & 15 deletions git-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,16 @@ in case of:

**MERGE CONFLICTS**

- on a particular line, if there is a change in one of the branches, and no change on the other branch, the CHANGE WILL WIN on the merge-commit
- on a particular line, if there is a change in one of the branches, and no change on the other branch, the **CHANGE WILL WIN** on the merge-commit
- if there are different changes on the same line, git tells you that automatic merge failes, fix conflicts. This time, using git status tells you 'You have unmerged paths' which means the merge is still on, and will complete when the conflicts are resolved.(at this stage we may abort using git merge --abort).
Now, go into the conflicting files, to see the changes git has made to indicate conflicts

<<<<<<<HEAD
```<<<<<<<HEAD
.. (status in HEAD)
======
.. (status in otherbranchname)
>>>>>>><other-branchname>
```

Just delete everything except what you want to keep, then use git add, to add the file to commit just like any other commit.
checking git status says 'all conflicts fixed, but still merging' Using 'git commmit' will conclude the merge-----
Expand All @@ -98,11 +99,6 @@ if we want to apply a specific stash, use `git stash apply <labelname>`

`git stash pop` this will apply the stashes and delete the stash






**USING REMOTE REPOS**

a git remote any location with a git repository- it could be a repo even on a co-worker's laptop, or another directory on our own system
Expand Down Expand Up @@ -153,7 +149,7 @@ to see all branches, use `git branch -a` To see only remote branches, use `git b
AMAZING TUTORIALS - courtesy David Mahler
https://www.youtube.com/watch?v=uR6G2v_WsRA

**VIDEO 1**
## All commands overview:

`git init` - initialize a new repo in a directory

Expand All @@ -179,8 +175,6 @@ https://www.youtube.com/watch?v=uR6G2v_WsRA

`git checkout (commit hash) filename` - retrieve a file from a previous commit

**VIDEO 2**

`git log` = git history

`git log --all --decorate --oneline --graph` = commit history graph
Expand Down Expand Up @@ -219,11 +213,6 @@ https://www.youtube.com/watch?v=uR6G2v_WsRA

`git stash save "(description)"` = create a stash point, be more descriptive


**VIDEO 3**

Commands used:

Retrieve/Clone a repo = `git clone (URL)`

List remotes = `git remote (-v for detail)`
Expand Down

0 comments on commit b4511bb

Please sign in to comment.