Skip to content

samyak1409/dev-diary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 

Repository files navigation

Developer Diary

Update all Python Packages

Open powershell and paste:

pip freeze | %{$_.split('==')[0]} | %{pip install --upgrade $_}

Pre-Project Process

  1. Make a new GitHub repo

  2. Copy the bash code of …or create a new repository on the command line

  3. Make a local dir for the project files and open Git Bash there

  4. Paste the copied bash code whose template is the following:

git init
echo "# Repository Name" >> README.md
git add README.md
git commit -m "init + readme"
git branch -M main
git remote add origin HTTPS_URL ("https://github.com/username/repository-name.git")
git push -u origin main

Go to i-th (a Previous) Commit

  1. Copy commit hash using:
git log
  1. Paste:
git reset copied_commit_hash

Either add the (new) changes and commit:

git add .
git commit -m "commit message"

Or restore the committed changes of copied_commit_hash:

git restore .
  1. Upload:
git push --force

--force because remote had the commits that we have reset locally

Overwrite Last Commit

  1. Add the changed files: (if there aren't any changed files, then the following steps will just change the commit message)
git add .
  1. Commit the changes:
git commit --amend -m "new commit message"
  1. Upload:
git push --force

GitHub Contribution Process with Examples

  1. Go to the repository you want to contribute, and fork

  2. Open Git Bash, clone the forked repo:

git clone https://github.com/samyak1409/first-contributions.git
  1. Add the remote-upstream (remote-origin is your (forked) repo, upstream-origin is repo from which you have forked):
git remote add upstream https://github.com/firstcontributions/first-contributions.git
  1. Create a new temp branch for PR and switch to it:
git branch add-samyak-jain
git checkout add-samyak-jain

Single command for this:

git checkout -b add-samyak-jain
  1. Now, make the desired changes in the files

  2. Add the changed files, commit, and push:

git add .
git commit -m "Add Samyak Jain to Contributors list"
git push origin add-samyak-jain
  1. Go to the repo, compare and create pull request

  2. Congrats! You just completed the standard Fork -> Clone -> Edit -> PR workflow that you'll encounter often as a contributor!

  3. Once the pull request is merged:

  • Delete the temp branch:
git branch -d add-samyak-jain
  • And then update origin:
git pull upstream
git push origin

README.md

CMD Hacks

Instantly hide a file/folder

Go to the parent dir, there, open cmd and paste:

Attrib +h +s +r "file_name"

To un-hide:

Attrib -h -s -r "file_name"

Copying the output of a command

command | clip

Open a window containing the list of all the previous commands used in the current session

Press F7

Most Voted Stack Overflow Questions

Most Voted LeetCode Discussions

Open-Source:

About

Some basic notes for software developers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published