Skip to content

Commit f9fbb7c

Browse files
authored
Merge pull request #15 from AP-XD/main
Change from master to main
2 parents 68147e4 + 5b03b8d commit f9fbb7c

File tree

1 file changed

+24
-13
lines changed

1 file changed

+24
-13
lines changed

README.md

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ This Repository is a guide to all the git commands you need to use in case any o
66
* [Basic Commands :v:](#basic-commands-v)
77
* [Branches :deciduous_tree:](#branches-deciduous_tree)
88
* [Update forked Repository with original Repository :hourglass:](#update-forked-repository-with-original-repository--hourglass)
9-
* [Dev branch is X commits behind and Y commits ahead of master](#your-dev-branch-is-x-commits-behind-and-y-commits-ahead-of-master-fix)
9+
* [Dev branch is X commits behind and Y commits ahead of main](#your-dev-branch-is-x-commits-behind-and-y-commits-ahead-of-main-fix)
10+
* [Reverting Commits :sunglasses:](#reverting-commits-sunglasses)
1011
* [Short hands](#short-hands)
1112
* [GitHub CLI commands](#github--cli-commands)
12-
* [Reverting Commits :sunglasses:](#reverting-commits-sunglasses)
13+
* [Signing Commits](#signing-commits)
1314

1415

1516
## Basic Commands :v:
@@ -37,7 +38,7 @@ git clone https://github.com/CodeChefVIT/git-cheatsheet.git
3738

3839
git add .
3940
git commit -m <commit message>
40-
git push origin master
41+
git push origin main
4142

4243
To add just one file or a set of files replace the . with your filename in first command
4344

@@ -189,42 +190,42 @@ now, when you add the files it ignores node_modules directory in your project.
189190

190191
Use the following if you want to rebase your branch:
191192
```
192-
git rebase upstream/master
193+
git rebase upstream/main
193194
```
194195

195196
Or use the merge command if you want to merge instead:
196197
```
197-
git merge upstream/master
198+
git merge upstream/main
198199
```
199200

200-
Replace "master" with the name of the branch on the forked repository that you want to rebase or merge with.
201+
Replace "main" with the name of the branch on the forked repository that you want to rebase or merge with.
201202

202203
**[⬆ Back to Index](#index-books)**
203204

204-
## Your dev branch is X commits behind and Y commits ahead of master fix
205+
## Your dev branch is X commits behind and Y commits ahead of main fix
205206

206207
```sh
207-
git checkout master
208+
git checkout main
208209

209-
git fetch origin master
210+
git fetch origin main
210211

211212
git checkout dev
212213

213-
git rebase origin/master
214+
git rebase origin/main
214215

215-
git checkout master
216+
git checkout main
216217

217218
git merge --no-ff dev
218219

219220
If you get this message 'Automatic merge failed; fix conflicts and then commit the result'
220221

221-
Check for merge conflicts in code and fix them (master branch should have required files now)
222+
Check for merge conflicts in code and fix them (main branch should have required files now)
222223

223224
For any such message deleted in 'dev and modified in HEAD. Version HEAD of requirements.txt left in tree'
224225

225226
File can either be deleted or modified or kept same
226227

227-
git pull origin master (if warning comes)
228+
git pull origin main (if warning comes)
228229

229230
add , commit , push
230231

@@ -338,3 +339,13 @@ Create a shortcut for a gh command.
338339
```
339340
340341
**[⬆ Back to Index](#index-books)**
342+
343+
## Signing Commits
344+
These steps are to be followed when you want to sign your current commit.
345+
```sh
346+
git commit --ammend --signoff
347+
for signing the current commit
348+
git push -f
349+
force pushes the changes to the current branch.
350+
```
351+
**[⬆ Back to Index](#index-books)**

0 commit comments

Comments
 (0)