随笔分类 -  Git

摘要:Empty commits might seem unusual, but they offer significant advantages in managing version control. By documenting milestones, triggering automation 阅读全文
posted @ 2023-07-16 01:32 Zhentiw 阅读(31) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2023-05-10 22:53 Zhentiw 阅读(16) 评论(0) 推荐(0) 编辑
摘要:name: Development pipeline on: pull_request: branches: - main jobs: Server: runs-on: ubuntu-22.04 steps: - name: Check files uses: actions/checkout@v3 阅读全文
posted @ 2023-02-05 00:42 Zhentiw 阅读(22) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2023-01-25 04:36 Zhentiw 阅读(19) 评论(0) 推荐(0) 编辑
摘要:git checkout yourBranch git reset --soft HEAD~$(git rev-list --count HEAD ^master) git add -A git commit -m "one commit on yourBranch" 阅读全文
posted @ 2021-10-01 16:45 Zhentiw 阅读(222) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2021-03-20 17:36 Zhentiw 阅读(33) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2021-02-17 21:24 Zhentiw 阅读(44) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2020-12-08 15:19 Zhentiw 阅读(229) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2020-03-02 14:20 Zhentiw 阅读(655) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2020-03-02 14:18 Zhentiw 阅读(352) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。
posted @ 2020-01-15 04:18 Zhentiw 阅读(1) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2020-01-13 15:57 Zhentiw 阅读(139) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2020-01-13 15:53 Zhentiw 阅读(147) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2020-01-09 15:01 Zhentiw 阅读(144) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2020-01-08 20:35 Zhentiw 阅读(131) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2020-01-08 20:29 Zhentiw 阅读(113) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2019-12-12 16:57 Zhentiw 阅读(146) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2019-12-12 16:41 Zhentiw 阅读(173) 评论(0) 推荐(0) 编辑
摘要: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, 阅读全文
posted @ 2019-05-17 22:26 Zhentiw 阅读(299) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2019-03-26 20:54 Zhentiw 阅读(263) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示