دستورات Git برای مهندسان نرم افزار

Summarize this content to 400 words in Persian Lang
معرفی
Git یک ابزار ضروری برای مهندسین نرم افزار است که امکان کنترل نسخه کارآمد، همکاری و مدیریت پروژه را فراهم می کند. چه در حال کار بر روی یک پروژه انفرادی یا بخشی از یک تیم بزرگ باشید، تسلط بر دستورات Git برای ساده کردن گردش کار توسعه شما بسیار مهم است. این راهنما متداولترین دستورات Git را که نیاز دارید پوشش میدهد و پایهای محکم برای مدیریت پایگاه کد، ردیابی تغییرات و هماهنگی با سایر توسعهدهندگان ارائه میدهد. با آشنایی با این دستورات، می توانید بهره وری خود را افزایش دهید و از پیشرفت نرم پروژه اطمینان حاصل کنید. بیایید به دستورات کلیدی Git بپردازیم که هر مهندس نرم افزار باید بداند.
پیکربندی
1. پیکربندی gitPurpose: Configure Git settings, such as user name and email.
Example: git config –global user.name “Your Name”
2. git initPurpose: Initialize a new Git repository.
Example: git init
3. git clonePurpose: Clone an existing repository.
Example: git clone https://github.com/user/repo.git
4. وضعیت gitPurpose: Show the working directory and staging area status.
Example: git status
5. git addPurpose: Add file contents to the index (staging area).
Example: git add . (add all files)
6. git commitPurpose: Record changes to the repository.
Example: git commit -m “Commit message”
7. git pushPurpose: Update remote refs along with associated objects.
Example: git push origin main
8. git pullPurpose: Fetch from and integrate with another repository or local branch.
Example: git pull origin main
9. شاخه gitPurpose: List, create, or delete branches.
Example: git branch new-branch (create new branch)
10. پرداخت gitPurpose: Switch branches or restore working tree files.
Example: git checkout new-branch (switch to branch)
11. سوئیچ gitPurpose: Switch branches.
Example: git switch new-branch
12. git ادغامPurpose: Join two or more development histories together.
Example: git merge new-branch (merge new-branch into current branch)
13. git rebasePurpose: Reapply commits on top of another base tip.
Example: git rebase main
14. git logPurpose: Show commit logs.
Example: git log –oneline
15. git diffPurpose: Show changes between commits, commit and working tree, etc.
Example: git diff (show unstaged changes)
16. git showPurpose: Show various types of objects.
Example: git show HEAD (show changes in the last commit)
17. git stashPurpose: Stash the changes in a dirty working directory away.
Example: git stash
18. git stash popPurpose: Apply the changes recorded in the stash to the working directory.
Example: git stash pop
19. git cleanPurpose: Remove untracked files from the working directory.
Example: git clean -fd
20. git remotePurpose: Manage set of tracked repositories.
Example: git remote add origin https://github.com/user/repo.git
21. git fetchPurpose: Download objects and refs from another repository.
Example: git fetch origin
22. git remote -vPurpose: Show the URLs that a remote name corresponds to.
Example: git remote -v
روز 23 gitPurpose: Create, list, delete, or verify a tag object.
Example: git tag -a v1.0 -m “Version 1.0”
24. git push origin –برچسب هاPurpose: Push all tags to the remote repository.
Example: git push origin –tags
25. git resetPurpose: Reset current HEAD to the specified state.
Example: git reset –hard HEAD~1 (reset to previous commit)
26. git revertPurpose: Create a new commit that undoes the changes from a previous commit.
Example: git revert HEAD
27. پرداخت git — Purpose: Discard changes in the working directory.
Example: git checkout — file.txt (discard changes in file.txt)
28. گیلاس چیدنPurpose: Apply the changes introduced by some existing commits.
Example: git cherry-pick
29. شاخه git -dPurpose: Delete a branch.
Example: git branch -d branch-name
30. شاخه git -DPurpose: Force delete a branch.
Example: git branch -D branch-name
31. git merge –no-offPurpose: Create a merge commit even when the merge resolves as a fast-forward.
Example: git merge –no-ff new-branch
32. git rebase -iPurpose: Start an interactive rebase.
Example: git rebase -i HEAD~3
33. git diff –stagedPurpose: Show changes between the index and the last commit.
Example: git diff –staged
34. سرزنش کردن
Purpose: Show what revision and author last modified each line of a file.
Example: git blame file.txt
وارد حالت تمام صفحه شوید
از حالت تمام صفحه خارج شوید
35. git log –graphPurpose: Show a graph of the commit history.
Example: git log –graph –oneline
36. git reflogPurpose: Show a log of all references.
Example: git reflog
37. git stash listPurpose: List all stashes.
Example: git stash list
38. git stash اعمال شودPurpose: Apply a stash to the working directory.
Example: git stash apply stash@{1}
39. git stash dropPurpose: Remove a single stash entry from the list of stashes.
Example: git stash drop stash@{1}
40. نمایش از راه دور gitPurpose: Show information about the remote repository.
Example: git remote show origin
41. git remote rmPurpose: Remove a remote.
Example: git remote rm origin
42. git pull –rebasePurpose: Fetch and rebase the current branch on top of the upstream branch.
Example: git pull –rebase origin main
43. git fetch –all
Purpose: Fetch all remotes.
Example: git fetch –all
وارد حالت تمام صفحه شوید
از حالت تمام صفحه خارج شوید
44. git bisectPurpose: Use binary search to find the commit that introduced a bug.
Example: git bisect start
45. زیر ماژول gitPurpose: Initialize, update, or inspect submodules.
Example: git submodule update –init
46. آرشیو gitPurpose: Create an archive of files from a named tree.
Example: git archive –format=tar HEAD > archive.tar
47. git shortlogPurpose: Summarize git log output.
Example: git shortlog -s -n
48. git توصیف کنید
Purpose: Give an object a human-readable name based on an available ref.
Example: git describe –tags
وارد حالت تمام صفحه شوید
از حالت تمام صفحه خارج شوید
49. git rev-parsePurpose: Parse revision (or other objects) and retrieve its hash.
Example: git rev-parse HEAD
50. تگ git -dPurpose: Delete a tag from the local repository.
Example: git tag -d v1.0
51. git checkout -bPurpose: Create and switch to a new branch.
Example: git checkout -b new-branch
52. git push origin –deletePurpose: Delete a remote branch.
Example: git push origin –delete branch-name
53. گیلاس گیلاسPurpose: Find commits not merged upstream.
Example: git cherry -v
54. git rmPurpose: Remove files from the working tree and from the index.
Example: git rm file.txt
55. git mvPurpose: Move or rename a file, directory, or symlink.
Example: git mv oldname.txt newname.txt
.56 git ریست HEADPurpose: Unstage changes.
Example: git reset HEAD file.txt
57. git log -pPurpose: Show changes over time for a specific file.
Example: git log -p file.txt
58. git diff –cachedPurpose: Show changes between the index and the last commit (same as –staged).
Example: git diff –cached
59. git اعمال می شودPurpose: Apply a patch to files and/or to the index.
Example: git apply patch.diff
60. git format-patchPurpose: Prepare patches for e-mail submission.
Example: git format-patch -1 HEAD
61. برو صبحPurpose: Apply a series of patches from a mailbox.
Example: git am
62. git cherry-pick –ادامه دهیدPurpose: Resume cherry-picking after resolving conflicts.
Example: git cherry-pick –continue
63. git fsckPurpose: Verify the connectivity and validity of objects in the database.
Example: git fsck
64. git gcPurpose: Cleanup unnecessary files and optimize the local repository.
Example: git gc
65. آلو خشک آلوPurpose: Remove unreachable objects from the object database.
Example: git prune
66. git notesPurpose: Add or inspect object notes.
Example: git notes add -m “Note message”
67. git whatchangedPurpose: Show what changed, similar to git log.
Example: git whatchanged
*68. git show-branch *Purpose: Show branches and their commits.
Example: git show-branch
69. git verify-tagPurpose: Check the GPG signature of tags.
Example: git verify-tag v1.0
70. git show-refPurpose: List references in a local repository.
Example: git show-ref
LinkedIn Account : لینکدینTwitter Account: توییتراعتبار: گرافیک ها از لینکدین تهیه شده است
معرفی
Git یک ابزار ضروری برای مهندسین نرم افزار است که امکان کنترل نسخه کارآمد، همکاری و مدیریت پروژه را فراهم می کند. چه در حال کار بر روی یک پروژه انفرادی یا بخشی از یک تیم بزرگ باشید، تسلط بر دستورات Git برای ساده کردن گردش کار توسعه شما بسیار مهم است. این راهنما متداولترین دستورات Git را که نیاز دارید پوشش میدهد و پایهای محکم برای مدیریت پایگاه کد، ردیابی تغییرات و هماهنگی با سایر توسعهدهندگان ارائه میدهد. با آشنایی با این دستورات، می توانید بهره وری خود را افزایش دهید و از پیشرفت نرم پروژه اطمینان حاصل کنید. بیایید به دستورات کلیدی Git بپردازیم که هر مهندس نرم افزار باید بداند.
پیکربندی
1. پیکربندی git
Purpose: Configure Git settings, such as user name and email.
Example: git config --global user.name "Your Name"
2. git init
Purpose: Initialize a new Git repository.
Example: git init
3. git clone
Purpose: Clone an existing repository.
Example: git clone https://github.com/user/repo.git
4. وضعیت git
Purpose: Show the working directory and staging area status.
Example: git status
5. git add
Purpose: Add file contents to the index (staging area).
Example: git add . (add all files)
6. git commit
Purpose: Record changes to the repository.
Example: git commit -m "Commit message"
7. git push
Purpose: Update remote refs along with associated objects.
Example: git push origin main
8. git pull
Purpose: Fetch from and integrate with another repository or local branch.
Example: git pull origin main
9. شاخه git
Purpose: List, create, or delete branches.
Example: git branch new-branch (create new branch)
10. پرداخت git
Purpose: Switch branches or restore working tree files.
Example: git checkout new-branch (switch to branch)
11. سوئیچ git
Purpose: Switch branches.
Example: git switch new-branch
12. git ادغام
Purpose: Join two or more development histories together.
Example: git merge new-branch (merge new-branch into current branch)
13. git rebase
Purpose: Reapply commits on top of another base tip.
Example: git rebase main
14. git log
Purpose: Show commit logs.
Example: git log --oneline
15. git diff
Purpose: Show changes between commits, commit and working tree, etc.
Example: git diff (show unstaged changes)
16. git show
Purpose: Show various types of objects.
Example: git show HEAD (show changes in the last commit)
17. git stash
Purpose: Stash the changes in a dirty working directory away.
Example: git stash
18. git stash pop
Purpose: Apply the changes recorded in the stash to the working directory.
Example: git stash pop
19. git clean
Purpose: Remove untracked files from the working directory.
Example: git clean -fd
20. git remote
Purpose: Manage set of tracked repositories.
Example: git remote add origin https://github.com/user/repo.git
21. git fetch
Purpose: Download objects and refs from another repository.
Example: git fetch origin
22. git remote -v
Purpose: Show the URLs that a remote name corresponds to.
Example: git remote -v
روز 23 git
Purpose: Create, list, delete, or verify a tag object.
Example: git tag -a v1.0 -m "Version 1.0"
24. git push origin –برچسب ها
Purpose: Push all tags to the remote repository.
Example: git push origin --tags
25. git reset
Purpose: Reset current HEAD to the specified state.
Example: git reset --hard HEAD~1 (reset to previous commit)
26. git revert
Purpose: Create a new commit that undoes the changes from a previous commit.
Example: git revert HEAD
27. پرداخت git —
Purpose: Discard changes in the working directory.
Example: git checkout -- file.txt (discard changes in file.txt)
28. گیلاس چیدن
Purpose: Apply the changes introduced by some existing commits.
Example: git cherry-pick
29. شاخه git -d
Purpose: Delete a branch.
Example: git branch -d branch-name
30. شاخه git -D
Purpose: Force delete a branch.
Example: git branch -D branch-name
31. git merge –no-off
Purpose: Create a merge commit even when the merge resolves as a fast-forward.
Example: git merge --no-ff new-branch
32. git rebase -i
Purpose: Start an interactive rebase.
Example: git rebase -i HEAD~3
33. git diff –staged
Purpose: Show changes between the index and the last commit.
Example: git diff --staged
34. سرزنش کردن
Purpose: Show what revision and author last modified each line of a file.
Example: git blame file.txt
35. git log –graph
Purpose: Show a graph of the commit history.
Example: git log --graph --oneline
36. git reflog
Purpose: Show a log of all references.
Example: git reflog
37. git stash list
Purpose: List all stashes.
Example: git stash list
38. git stash اعمال شود
Purpose: Apply a stash to the working directory.
Example: git stash apply stash@{1}
39. git stash drop
Purpose: Remove a single stash entry from the list of stashes.
Example: git stash drop stash@{1}
40. نمایش از راه دور git
Purpose: Show information about the remote repository.
Example: git remote show origin
41. git remote rm
Purpose: Remove a remote.
Example: git remote rm origin
42. git pull –rebase
Purpose: Fetch and rebase the current branch on top of the upstream branch.
Example: git pull --rebase origin main
43. git fetch –all
Purpose: Fetch all remotes.
Example: git fetch --all
44. git bisect
Purpose: Use binary search to find the commit that introduced a bug.
Example: git bisect start
45. زیر ماژول git
Purpose: Initialize, update, or inspect submodules.
Example: git submodule update --init
46. آرشیو git
Purpose: Create an archive of files from a named tree.
Example: git archive --format=tar HEAD > archive.tar
47. git shortlog
Purpose: Summarize git log output.
Example: git shortlog -s -n
48. git توصیف کنید
Purpose: Give an object a human-readable name based on an available ref.
Example: git describe --tags
49. git rev-parse
Purpose: Parse revision (or other objects) and retrieve its hash.
Example: git rev-parse HEAD
50. تگ git -d
Purpose: Delete a tag from the local repository.
Example: git tag -d v1.0
51. git checkout -b
Purpose: Create and switch to a new branch.
Example: git checkout -b new-branch
52. git push origin –delete
Purpose: Delete a remote branch.
Example: git push origin --delete branch-name
53. گیلاس گیلاس
Purpose: Find commits not merged upstream.
Example: git cherry -v
54. git rm
Purpose: Remove files from the working tree and from the index.
Example: git rm file.txt
55. git mv
Purpose: Move or rename a file, directory, or symlink.
Example: git mv oldname.txt newname.txt
.56 git ریست HEAD
Purpose: Unstage changes.
Example: git reset HEAD file.txt
57. git log -p
Purpose: Show changes over time for a specific file.
Example: git log -p file.txt
58. git diff –cached
Purpose: Show changes between the index and the last commit (same as --staged).
Example: git diff --cached
59. git اعمال می شود
Purpose: Apply a patch to files and/or to the index.
Example: git apply patch.diff
60. git format-patch
Purpose: Prepare patches for e-mail submission.
Example: git format-patch -1 HEAD
61. برو صبح
Purpose: Apply a series of patches from a mailbox.
Example: git am
62. git cherry-pick –ادامه دهید
Purpose: Resume cherry-picking after resolving conflicts.
Example: git cherry-pick --continue
63. git fsck
Purpose: Verify the connectivity and validity of objects in the database.
Example: git fsck
64. git gc
Purpose: Cleanup unnecessary files and optimize the local repository.
Example: git gc
65. آلو خشک آلو
Purpose: Remove unreachable objects from the object database.
Example: git prune
66. git notes
Purpose: Add or inspect object notes.
Example: git notes add -m "Note message"
67. git whatchanged
Purpose: Show what changed, similar to git log.
Example: git whatchanged
*68. git show-branch *
Purpose: Show branches and their commits.
Example: git show-branch
69. git verify-tag
Purpose: Check the GPG signature of tags.
Example: git verify-tag v1.0
70. git show-ref
Purpose: List references in a local repository.
Example: git show-ref
LinkedIn Account
: لینکدینTwitter Account
: توییتر
اعتبار: گرافیک ها از لینکدین تهیه شده است