Open powershell and paste:
pip freeze | %{$_.split('==')[0]} | %{pip install --upgrade $_}
-
Copy the bash code of
…or create a new repository on the command line
-
Make a local dir for the project files and open Git Bash there
-
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
- Copy commit hash using:
git log
- 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 .
- Upload:
git push --force
--force
because remote had the commits that we have reset locally
- Add the changed files: (if there aren't any changed files, then the following steps will just change the commit message)
git add .
- Commit the changes:
git commit --amend -m "new commit message"
- Upload:
git push --force
-
Go to the repository you want to contribute, and fork
-
Open Git Bash, clone the forked repo:
git clone https://github.com/samyak1409/first-contributions.git
- 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
- 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
-
Now, make the desired changes in the files
-
Add the changed files, commit, and push:
git add .
git commit -m "Add Samyak Jain to Contributors list"
git push origin add-samyak-jain
-
Go to the repo, compare and create pull request
-
Congrats! You just completed the standard
Fork -> Clone -> Edit -> PR
workflow that you'll encounter often as a contributor! -
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
-
Badges to put in README:
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"
command | clip
Press F7