随笔分类 - Git
摘要:Empty commits might seem unusual, but they offer significant advantages in managing version control. By documenting milestones, triggering automation
阅读全文
摘要:docker exec container-id sh -c "patch -p1 < your-file.diff" Replace container-id with the ID of the container you want to run the command in, and your
阅读全文
摘要:name: Development pipeline on: pull_request: branches: - main jobs: Server: runs-on: ubuntu-22.04 steps: - name: Check files uses: actions/checkout@v3
阅读全文
摘要:Sometimes we when switch branch, might bring some modified files into the new branch to cleanup those files git clean -df https://git-scm.com/docs/git
阅读全文
摘要:git checkout yourBranch git reset --soft HEAD~$(git rev-list --count HEAD ^master) git add -A git commit -m "one commit on yourBranch"
阅读全文
摘要:In project, we can have three branches such as dev stage master Every developer can merge their code into 'dev' branch. 'stage' & 'master' will be loc
阅读全文
摘要:1. Download the git repo into local. 2. Copy the SSH / HTTPS URL from CodeCommit Repo Then run: git remote set-url origin ssh://code-commit.address.xx
阅读全文
摘要:You can do git log first to check which commit message you want to revert to. For example 'xxxxx123' is the commit id we want to revert to. Then do: g
阅读全文
摘要:Create a .github directory at the root of your project Add a file called pull_request_template.md . Here's an example: This PR... ## Changes - ## Scre
阅读全文
摘要:Create a .github directory at the root of your project Create an ISSUE_TEMPLATE directory inside the .github directory Add a file called bug_report.md
阅读全文
只有注册用户登录后才能阅读该文。
摘要:We make a .env file and accidentally push it to github. In order to remove the .env file, we first have to add it to our .gitignore file - but that's
阅读全文
摘要:We've made a pull request and now we can clean up the branches by deleting the feature branch. Branches are just pointers to commits - so we can safel
阅读全文
摘要:Once a commit is pushed, you do NOT want to use git reset to undo it - because reset will rewrite the history tree, and anyone who has already pulled
阅读全文
摘要:If you've removed a commit with git reset --hard, it's still possible to recover the commit using git reflog to look up the commit hash. Once we find
阅读全文
摘要:git reset has three primary options that we might use: --soft, --hard and --mixed (the default). We'll use git reset to undo the latest commit in all
阅读全文
摘要:If you've added files to the staging area (the Index) accidentally - you can remove them using git reset. We'll first add a file to staging, but then
阅读全文
摘要:Change a Commit Message that Hasn't Been Pushed Yet If you make a mistake in a commit message but HAVEN'T pushed it yet, you can change that commit me
阅读全文
摘要:Many times we might changed one file which we don't intent to do... but it was too late, until we found it, it is already push to repo. Let's assume,
阅读全文
摘要:If we pushed our changes already to the remote repository we have to pay attention to not change the git history (using commands like rebase, reset, a
阅读全文