All git commands list

๐—ด๐—ถ๐˜ ๐—ถ๐—ป๐—ถ๐˜: It is used to initialize a new Git repository in working directory.

๐—ด๐—ถ๐˜ ๐—ฐ๐—น๐—ผ๐—ป๐—ฒ <๐—ฟ๐—ฒ๐—ฝ๐—ผ> : It is used to take the clone or copy of existing project in your local machine.

๐— ๐—ฎ๐—ธ๐—ฒ ๐—–๐—ต๐—ฎ๐—ป๐—ด๐—ฒ๐˜€

๐—ด๐—ถ๐˜ ๐˜€๐˜๐—ฎ๐˜๐˜‚๐˜€: It is used to check the status of changes in files of working project. using git status command you can view the files/changes that are currently unstaged.

๐—ด๐—ถ๐˜ ๐—ฎ๐—ฑ๐—ฑ <๐—ณ๐—ถ๐—น๐—ฒ๐—ป๐—ฎ๐—บ๐—ฒ> : When you made the changes in your files you’ll want to stage them for a commit. git add command adds a specific file to the stage.

๐—ด๐—ถ๐˜ ๐—ฎ๐—ฑ๐—ฑ . ๐—ผ๐—ฟ ๐—ด๐—ถ๐˜ ๐—ฎ๐—ฑ๐—ฑ -๐—”: Using this command you can add all your changed files to the stage with one command Instead of adding files one by one.

๐—ด๐—ถ๐˜ ๐—ฐ๐—ผ๐—บ๐—บ๐—ถ๐˜ -๐—บ “๐—–๐—ผ๐—บ๐—บ๐—ถ๐˜ ๐—บ๐—ฒ๐˜€๐˜€๐—ฎ๐—ด๐—ฒ”: Now you can commit all your stages changes/files with a descriptive message.

๐—•๐—ฟ๐—ฎ๐—ป๐—ฐ๐—ต๐—ถ๐—ป๐—ด

git branch <๐—ฏ๐—ฟ๐—ฎ๐—ป๐—ฐ๐—ต๐—ป๐—ฎ๐—บ๐—ฒ>: For create a new branch this command (git branch branchname) is used.

๐—ด๐—ถ๐˜ ๐—ฏ๐—ฟ๐—ฎ๐—ป๐—ฐ๐—ต: This command is used for list all the local branches in your current repository.

๐—ด๐—ถ๐˜ ๐—ฐ๐—ต๐—ฒ๐—ฐ๐—ธ๐—ผ๐˜‚๐˜ <๐—ฏ๐—ฟ๐—ฎ๐—ป๐—ฐ๐—ต๐—ป๐—ฎ๐—บ๐—ฒ> : Using this branch you can switch to a different branch.

๐—ด๐—ถ๐˜ ๐—บ๐—ฒ๐—ฟ๐—ด๐—ฒ <๐—ฏ๐—ฟ๐—ฎ๐—ป๐—ฐ๐—ต๐—ป๐—ฎ๐—บ๐—ฒ> : If you want to bring your changes from one branch to another you can use git merge command

๐—ฅ๐—ฒ๐—บ๐—ผ๐˜๐—ฒ ๐—ฅ๐—ฒ๐—ฝ๐—ผ๐˜€๐—ถ๐˜๐—ผ๐—ฟ๐—ถ๐—ฒ๐˜€

๐—ด๐—ถ๐˜ ๐—ฝ๐˜‚๐˜€๐—ต ๐—ผ๐—ฟ๐—ถ๐—ด๐—ถ๐—ป <๐—ฏ๐—ฟ๐—ฎ๐—ป๐—ฐ๐—ต๐—ป๐—ฎ๐—บ๐—ฒ> : Using this command you can sends your commits to the remote repository.

๐—ด๐—ถ๐˜ ๐—ฝ๐˜‚๐—น๐—น: If many people are working in same project you’ll want to keep your repo up to date using git pull command you can fetch and merge all changes from the remote repository

๐—ด๐—ถ๐˜ ๐—ฟ๐—ฒ๐—บ๐—ผ๐˜๐—ฒ -๐˜ƒ :This command is used to check which remote servers are connected with local repository.

๐—ž๐—ฒ๐˜† ๐——๐—ถ๐—ณ๐—ณ๐—ฒ๐—ฟ๐—ฒ๐—ป๐—ฐ๐—ฒ๐˜€

๐—ด๐—ถ๐˜ ๐—ณ๐—ฒ๐˜๐—ฐ๐—ต ๐˜ƒ๐˜€ ๐—ด๐—ถ๐˜ ๐—ฝ๐˜‚๐—น๐—น: Both download data from a remote repository. However, git fetch just downloads it without integrating it while git pull also merges it into your local files.

๐—ด๐—ถ๐˜ ๐—บ๐—ฒ๐—ฟ๐—ด๐—ฒ ๐˜ƒ๐˜€ ๐—ด๐—ถ๐˜ ๐—ฟ๐—ฒ๐—ฏ๐—ฎ๐˜€๐—ฒ: Both incorporate changes from one branch to another. git merge combines the source and target branches via a new commit, whereas git rebase moves or combines commits to a new base, making a cleaner history.

๐—ด๐—ถ๐˜ ๐—ฟ๐—ฒ๐˜€๐—ฒ๐˜ ๐˜ƒ๐˜€ ๐—ด๐—ถ๐˜ ๐—ฟ๐—ฒ๐˜ƒ๐—ฒ๐—ฟ๐˜: Both are used to undo changes. git reset discards local changes completely, while git revert undoes public changes by creating a new reversing commit thereby preserving history.

Happy Learning ๐Ÿ™‚

Leave a Reply

Your email address will not be published. Required fields are marked *