git_basics icon indicating copy to clipboard operation
git_basics copied to clipboard

Features to be added to the `git commands` section.

Open HarshKapadia2 opened this issue 4 years ago • 28 comments

HarshKapadia2 avatar May 15 '20 22:05 HarshKapadia2

HarshKapadia2 avatar May 17 '20 14:05 HarshKapadia2

Add all info from the following articles:

  • [ ] https://medium.com/mindorks/what-is-git-commit-push-pull-log-aliases-fetch-config-clone-56bc52a3601c
  • [ ] https://dev.to/lydiahallie/cs-visualized-useful-git-commands-37p1

HarshKapadia2 avatar May 17 '20 14:05 HarshKapadia2

Under the git command in this section, add:

HarshKapadia2 avatar May 17 '20 20:05 HarshKapadia2

  • [ ] git revert
  • [ ] git restore
  • [ ] git reset (+ add commands from #75, although it is meant for #10)

HarshKapadia2 avatar Jul 11 '20 15:07 HarshKapadia2

HarshKapadia2 avatar Jul 11 '20 15:07 HarshKapadia2

  • [ ] Add the git cherry-pick command.

HarshKapadia2 avatar Jul 17 '20 15:07 HarshKapadia2

  • [ ] Under git checkout, add the --orphan flag.
    • Ref article
    • Add the flag, give an explanation on what is does and its need.
    • git rm -rf or git reset --hard might be required (beware of the file not in .gitignore though.) (source)

HarshKapadia2 avatar Jul 17 '20 15:07 HarshKapadia2

  • [ ] Under the --amend flag in git commit, add the --no-edit option.
    • Explain that files can be forgotten to be committed or be committed by mistake & add the two cases of amending a commit (to change the commit msg/descp and/or add/remove a file) to the common mistakes and how to solve them (#10) sub-section.
  • [ ] git commit --no-value option
  • [x] Add --author "Full Name <[email protected]>" option to git commit.

HarshKapadia2 avatar Jul 21 '20 08:07 HarshKapadia2

  • [ ] Add a --staged flag to the git diff command.
  • [ ] Add the git mv command.

HarshKapadia2 avatar Aug 17 '20 19:08 HarshKapadia2

  • [ ] Co-authored commits
    • (I had to use a text editor to write the commit msg as pressing the enter key in cmd executes the command.)
    • https://github.blog/2018-01-29-commit-together-with-co-authors/
    • https://medium.com/blackode/creating-co-authored-commits-on-the-command-line-git-305ae2af9f73

HarshKapadia2 avatar Aug 20 '20 14:08 HarshKapadia2

  • [ ] Add set-url option to git remote
    • https://www.git-scm.com/docs/git-remote

HarshKapadia2 avatar Aug 27 '20 23:08 HarshKapadia2

  • [ ] git shortlog
    • Add details on git shortlog from this as well: https://github.blog/2020-10-19-git-2-29-released/

HarshKapadia2 avatar Oct 21 '20 14:10 HarshKapadia2

  • [ ] Contextual git push and git pull. (Find context using git branch.)
    • Executing just git push instead of git push origin main to push code to the main branch.
    • Might not work the first time as the upstream is not set. Use git push -u origin main the first time.

HarshKapadia2 avatar Dec 01 '20 12:12 HarshKapadia2

  • [x] Add git config --global init.defaultBranch <branch_name> to the git config sub-section.
    • This is to combat the new default main branch on GitHub.
    • Add note that this is only for GitHub and might cause problems with other services like GitLab.
    • Refer to this comment of issue #47.

HarshKapadia2 avatar Feb 20 '21 08:02 HarshKapadia2

  • [ ] From image below make the following changes to the git branch sub-section:
    • Make necessary changes to -m option in web site.
      • Check if what already exists is correct and accordingly make changes.
    • Add -u flag.
    • Add references to the branch renaming section if necessary. (The section is supposed to be added as per a comment in issue #21.)

image

HarshKapadia2 avatar Feb 20 '21 22:02 HarshKapadia2

  • [ ] Add git reflog documentation
    • Write about force pushing (Add note: changes history and can cause a lot of problems)

HarshKapadia2 avatar Mar 23 '21 09:03 HarshKapadia2

  • [ ] Add commands from issue #70.
  • [ ] Add git fsck

HarshKapadia2 avatar May 16 '21 05:05 HarshKapadia2

HarshKapadia2 avatar Jul 30 '21 17:07 HarshKapadia2

HarshKapadia2 avatar Oct 13 '21 05:10 HarshKapadia2

  • [ ] Add directory option to git clone.
    • Eg: git clone <url>.git <dir_to_clone_into> or git clone <url>.git . (Same directory, will not create a new directory to put the files in.)

HarshKapadia2 avatar Oct 23 '21 09:10 HarshKapadia2

  • [ ] Changing the default Git editor.
    • git config --global core.editor "<editor_name>"
    • VS Code: git config --global core.editor "code --wait" (Article)
    • Others: (Article)

HarshKapadia2 avatar Oct 27 '21 22:10 HarshKapadia2

  • [x] Add git add -p

HarshKapadia2 avatar Nov 18 '21 08:11 HarshKapadia2

  • [x] #85

HarshKapadia2 avatar Dec 08 '21 12:12 HarshKapadia2

  • Merge conflicts: #94

HarshKapadia2 avatar Feb 09 '22 21:02 HarshKapadia2

HarshKapadia2 avatar Feb 18 '23 04:02 HarshKapadia2