Skip to content

Commit 19eb1a7

Browse files
authored
Update README.md
1 parent d489daf commit 19eb1a7

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

README.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11

2-
<b>GitHub Branching Commands</b>
2+
# Github Basics<br><br>
3+
4+
## GitHub Branching Commands
35

46
<b>Create Branch:</b> ```git branch <new-branch-name>``` </br>
57
<b>View all branches:</b> ```git branch -a``` </br>
@@ -34,6 +36,7 @@
3436

3537
<b>Show commit history:</b> ```git log --oneline``
3638

39+
## Rebasing and Merging
3740
<b><ins>Incorporate your feature branch changes into development</ins></b> <br/>
3841
1.) ```git pull development```<br/>
3942
2.) ```git branch feature-branch```<br/>
@@ -57,13 +60,13 @@
5760
14 - 16 can also be done via GitHub via Pull request to review changes before the merge
5861

5962
<b><ins>You have uncommitted changes in a local branch and want to switch to another branch without passing over those changes</ins></b> <br>
60-
Step 1: You are on `branch-A` with uncommitted changes
61-
```git stash``` # Save changes and clean the working directory
62-
```git checkout branch-B``` # Switch to another branch (e.g., branch-B)
63+
Step 1: You are on `branch-A` with uncommitted changes<br>
64+
```git stash``` # Save changes and clean the working directory<br>
65+
```git checkout branch-B``` # Switch to another branch (e.g., branch-B)<br>
6366

64-
Step 2: Work on `branch-B` and then return to `branch-A`
65-
```git checkout branch-A``` # Switch back to the original branch
66-
```git stash apply``` # Restore the stashed changes on `branch-A`
67+
Step 2: Work on `branch-B` and then return to `branch-A` <br>
68+
```git checkout branch-A``` # Switch back to the original branch<br>
69+
```git stash apply``` # Restore the stashed changes on `branch-A`<br>
6770

6871

6972
<b><ins>How to Abort the rebase and restore the branch to its original state.</ins></b> <br>
@@ -76,7 +79,7 @@ Step 2: Work on `branch-B` and then return to `branch-A`
7679
1.) `git fetch origin` - Updates your local information about the remote branches without changing your working branch <br>
7780
2.) `git reset --hard origin/your-branch-name` - `Forces your local branch to match the remote branch exactly, discarding any local changes or commits that differ from the remote branch`
7881

79-
<b><ins>Troubleshooting Git</ins></b> <br/>
82+
## Troubleshooting Git</ins></b><br>
8083

8184
<b>Issue #1</b><br>
8285
After performing <b>git pull</b> you get this error:
@@ -86,7 +89,11 @@ After performing <b>git pull</b> you get this error:
8689

8790
<b>Issue #2</b><br/>
8891
After performing a ```git push -f``` or ```git push -u origin your-feature-branch``` you get this:<br>
89-
```the upstream branch of your current branch does not match the name of your current branch```<br><br>
92+
93+
```
94+
the upstream branch of your current branch does not match the name of your current branch
95+
```
96+
9097
<b>Solution:</b> <br>
9198
Your local and remote branch have different names<br><br>
9299
<b>2 possible solutions</b><br>

0 commit comments

Comments
 (0)