{"id":16475427,"url":"https://github.com/avinal/configs-and-tricks","last_synced_at":"2025-02-28T09:36:41.792Z","repository":{"id":115432258,"uuid":"323662058","full_name":"avinal/Configs-and-Tricks","owner":"avinal","description":"My Custom configurations Scripts.","archived":false,"fork":false,"pushed_at":"2022-03-06T15:52:54.000Z","size":85,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-22T01:32:00.986Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/avinal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-22T15:22:33.000Z","updated_at":"2022-10-05T22:41:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"8ed45620-9cde-46c3-a4f4-271515cb2187","html_url":"https://github.com/avinal/Configs-and-Tricks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avinal%2FConfigs-and-Tricks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avinal%2FConfigs-and-Tricks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avinal%2FConfigs-and-Tricks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avinal%2FConfigs-and-Tricks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avinal","download_url":"https://codeload.github.com/avinal/Configs-and-Tricks/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241131858,"owners_count":19915020,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T12:38:10.585Z","updated_at":"2025-02-28T09:36:41.770Z","avatar_url":"https://github.com/avinal.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Configurations and Tricks\nMy custom configuration scripts and tricks\n\n\n1. Customise your Bash Prompt\n\n    \u003cimg src=\"bash/custom_bash_prompt.png\" target=\"bash/custom_prompt.sh\"\u003e\n\n    - To apply this theme open your bash config\n    ```bash\n    nano ~/.bashrc\n    # you may use any text editor e.g - vim\n    vim ~/.bashrc\n    ```\n    - Copy the contents of [custom_prompt.sh](custom_prompt.sh) to the end of `.bashrc`.\n    - Save config file and exit\n    ```bash\n    # for nano \n    Ctrl + O \n    Enter\n    Ctrl + X\n    # for vim\n    :w\n    :q\n    ```\n    - Relaunch terminal or run following command\n    ```bash\n    source ~/.bashrc\n    ```\n    - You can change colors and add others options too, currently it shows *time*, *user@host*, *current directory*, *active git branch*,*conda virtual environment* and cute little emojis showing the success of last command. (😎:😩), Some terminals may not support emojis, replace with :) and :( in that case\n\n\n2. Customise your PowerShell prompt\n\n    \u003cimg src=\"powershell/custom_prompt.png\" target=\"powershell/profile.ps1\"\u003e\n\n    - Set script execution policy, open a powershell with admin\n    ```powershell\n    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force\n    ```\n    - To apply this prompt you first need to find if there is an existing configuration\n    ```powershell\n    if (!(Test-Path -Path $PROFILE)){ New-Item -Path $PROFILE -ItemType File } ; notepad $PROFILE\n    ```\n    - Copy the contents of [profile.ps1](powershell/profile.ps1) to this file, save and exit\n    - Relaunch your powershell\n\n3. Rebase and sqash commits of an active pull request (git)\n\n    - Confirm or configure upstream\n    ```bash\n    # make sure you have a upstream configured, to check type \n    git remote -v\n    # result will have origin and upstream as below\n        origin  https://github.com/\u003cyou\u003e/\u003crepo\u003e.git (fetch)\n        origin  https://github.com/\u003cyou\u003e/\u003crepo\u003e.git (push)\n        upstream        https://github.com/\u003cowner\u003e/\u003crepo\u003e.git (fetch)\n        upstream        https://github.com/\u003cowner\u003e/\u003crepo\u003e.git (push)\n    ```\n    If yes skip next step\n    - Add a upstream \n    ```bash\n    git remote add upstream https://github.com/\u003cowner\u003e/\u003crepo\u003e.git\n    ```\n    Again check with previous command\n    - Update your fork\n    ```bash\n    # fetch updates from upstream\n    git fetch upstream\n    # checkout master or main branch\n    git checkout master\n    # push update to your fork\n    git push\n    ```\n    - Rebase your pull request, checkout the original branch used to create pull request\n    ```bash\n    git checkout pull-request-branch\n    # rebase this branch\n    git rebase upstream/master\n    ```\n    If you want to sqash your commits then follow the step or skip to last\n    - reset last `n` commits\n    ```bash\n    git reset --soft HEAD~n\n    # new sqashed commit\n    git commit -m \"commit message\"\n    ```\n    - Push your changes\n    ```bash\n    git push origin +pull-request-branch\n    ```\n    **+** is required to put before branch name since you are rewriting the history and forcely pushing it\n\n4. Split a commit in already pushed code or active pull request\n    - Rebase last `n` commits\n    ```bash\n    git rebase -i HEAD~n\n    ```\n    In the interactive screen simply replace *pick* with *edit* in front of the commits you want to modify\n    ```bash\n    git reset HEAD~\n    ```\n    - Add your files again and commit \n    ```bash\n    git add ...\n    git commit -m \"commit 1 message\"\n\n    git add ...\n    git commit -m \"commit 2 message\"\n    .\n    .\n    git add ...\n    git commit -m \"last commit message\"\n    ```\n    - Continue rebasing\n    ```bash\n    git rebase --continue\n    ```\n    - Push your changes\n    ```bash\n    git push origin +branch-name\n    ```\n    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favinal%2Fconfigs-and-tricks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favinal%2Fconfigs-and-tricks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favinal%2Fconfigs-and-tricks/lists"}