Git Main commands

0
417

๐—ด๐—ถ๐˜ ๐—ฐ๐—น๐—ผ๐—ป๐—ฒ <๐—ฟ๐—ฒ๐—ฝ๐—ผ> : To work on an existing project, you’ll want to clone (copy) it to your local machine. This command does that.

๐—ด๐—ถ๐˜ ๐—ฐ๐—ต๐—ฒ๐—ฐ๐—ธ๐—ผ๐˜‚๐˜ -b <๐—ฏ๐—ฟ๐—ฎ๐—ป๐—ฐ๐—ต๐—ป๐—ฎ๐—บ๐—ฒ> : If you want to switch to a different branch, use this command.

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

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

๐—ด๐—ถ๐˜ ๐—ฐ๐—ผ๐—บ๐—บ๐—ถ๐˜ -๐—บ “๐—–๐—ผ๐—บ๐—บ๐—ถ๐˜ ๐—บ๐—ฒ๐˜€๐˜€๐—ฎ๐—ด๐—ฒ” : Now that your changes are staged, you can commit them with a descriptive message.

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

Git is an extremely powerful tool with plenty more commands and options.

However, this guide gives you a good start and reference point as you continue to explore and leverage Git for your version control needs.