๐—›๐—ผ๐˜„ ๐—š๐—œ๐—ง ๐—ช๐—ผ๐—ฟ๐—ธ๐˜€

๐—›๐—ผ๐˜„ ๐—š๐—œ๐—ง ๐—ช๐—ผ๐—ฟ๐—ธ๐˜€

ยท

4 min read

Git is a distributed version control tool that facilitates the monitoring of changes made to your code over time. Git makes it simple to track changes to your codebase and collaborate on projects with others. It was authored by Linus Torvalds in 2005 for the development of the ๐—Ÿ๐—ถ๐—ป๐˜‚๐˜… ๐—ธ๐—ฒ๐—ฟ๐—ป๐—ฒ๐—น, with other kernel developers contributing to its initial development.

It enables us to ๐˜๐—ฟ๐—ฎ๐—ฐ๐—ธ ๐—ฐ๐—ต๐—ฎ๐—ป๐—ด๐—ฒ๐˜€ ๐—ถ๐—ป ๐—ผ๐˜‚๐—ฟ ๐—ฐ๐—ผ๐—ฑ๐—ฒ ๐—ฎ๐—ป๐—ฑ ๐—ฐ๐—ผ๐—น๐—น๐—ฎ๐—ฏ๐—ผ๐—ฟ๐—ฎ๐˜๐—ฒ ๐˜„๐—ถ๐˜๐—ต ๐—ผ๐˜๐—ต๐—ฒ๐—ฟ๐˜€, by working on a different part of a codebase independently. When we say distributed, we may think that we have code on two locations, remote server and locally, but the story is a bit more complex than that.

Git has three storages locally: a Working directory, Staging Area, and a Local repository.

๐Ÿญ. ๐—ช๐—ผ๐—ฟ๐—ธ๐—ถ๐—ป๐—ด ๐——๐—ถ๐—ฟ๐—ฒ๐—ฐ๐˜๐—ผ๐—ฟ๐˜†โ€Šโ€”โ€ŠThis is the area where are you working and your files live (also called โ€œuntrackedโ€). All file changes here will be marked and if not saved to GIT, you will lose them. The reason is that GIT is not aware of those files.

๐Ÿฎ. ๐—ฆ๐˜๐—ฎ๐—ด๐—ถ๐—ป๐—ด ๐—”๐—ฟ๐—ฒ๐—ฎโ€Šโ€”โ€ŠWhen you save your changes with git add, GIT will start tracking and saving your changes with files. These changes are stored in the .git directory. Then, files are moved from Working Directory to Staging Area. Still, if you make changes to these files, GIT will not know about them, you need to tell GIT to notice those changes.

๐Ÿฏ. ๐—Ÿ๐—ผ๐—ฐ๐—ฎ๐—น ๐—ฅ๐—ฒ๐—ฝ๐—ผ๐˜€๐—ถ๐˜๐—ผ๐—ฟ๐˜†โ€Šโ€”โ€ŠIt is the area where everything is saved (commits) in the .git directory. When you want to move your files from Staging Area to Local Repository, you can use the git commit command. After this, your Staging area will be empty. If you want to see what is in the Local repository, try git log.

Some basic ๐—š๐—œ๐—ง ๐—ฐ๐—ผ๐—บ๐—บ๐—ฎ๐—ป๐—ฑ๐˜€ are:

๐Ÿ”น ๐—ด๐—ถ๐˜ ๐—ถ๐—ป๐—ถ๐˜ -> Create a new git repo in the directory
๐Ÿ”น ๐—ด๐—ถ๐˜ ๐—ฏ๐—ฟ๐—ฎ๐—ป๐—ฐ๐—ต -> Create a new local branch
๐Ÿ”น ๐—ด๐—ถ๐˜ ๐—ฐ๐—ต๐—ฒ๐—ฐ๐—ธ๐—ผ๐˜‚๐˜ -> Switch branches
๐Ÿ”น ๐—ด๐—ถ๐˜ ๐—ฎ๐—ฑ๐—ฑ -> Add a new file to your staging area
๐Ÿ”น ๐—ด๐—ถ๐˜ ๐—ฐ๐—ผ๐—บ๐—บ๐—ถ๐˜ -> Adds staged changes to your local repository
๐Ÿ”น ๐—ด๐—ถ๐˜ ๐—ฝ๐˜‚๐—น๐—น -> pull code from your remote repo to your local directory
๐Ÿ”น ๐—ด๐—ถ๐˜ ๐—ฝ๐˜‚๐˜€๐—ต -> Push local repository changes to your remote repo
๐Ÿ”น ๐—ด๐—ถ๐˜ ๐˜€๐˜๐—ฎ๐˜๐˜‚๐˜€ -> Show which files are being tracked (and untracked)
๐Ÿ”น ๐—ด๐—ถ๐˜ ๐—ฑ๐—ถ๐—ณ๐—ณ -> See the actual difference in code between your Working Directory and your Staging Area

Along with GIT commands, you can try and use some popular ๐—š๐—œ๐—ง ๐˜๐—ผ๐—ผ๐—น๐˜€: GitHub Desktop, SourceTree, TortoiseGit, Git Extensions, GitKraken, SmartGit, Tower, etc.

Just be ready and start preparing for the move if you need to. If you would like my advice on improving your profile and resume, I can help you. ๐—œ ๐—ฝ๐—ฒ๐—ฟ๐˜€๐—ผ๐—ป๐—ฎ๐—น๐—น๐˜† ๐˜€๐—ฝ๐—ฒ๐—ป๐—ฑ ๐Ÿฏ๐Ÿฌ+ ๐—บ๐—ถ๐—ป๐˜‚๐˜๐—ฒ๐˜€ ๐—ผ๐—ป ๐—ฒ๐—ฎ๐—ฐ๐—ต ๐—ฎ๐—ฝ๐—ฝ๐—น๐—ถ๐—ฐ๐—ฎ๐—ป๐˜ ๐˜๐—ผ ๐—บ๐—ฎ๐—ธ๐—ฒ ๐˜๐—ต๐—ฒ ๐—ฟ๐—ฒ๐˜€๐˜‚๐—บ๐—ฒ ๐—ฎ๐—ป๐—ฑ ๐—Ÿ๐—ถ๐—ป๐—ธ๐—ฒ๐—ฑ๐—œ๐—ป ๐—ฝ๐—ฟ๐—ผ๐—ณ๐—ถ๐—น๐—ฒ ๐—ถ๐—ป๐˜๐—ฒ๐—ฟ๐˜ƒ๐—ถ๐—ฒ๐˜„ ๐—บ๐—ฎ๐—ด๐—ป๐—ฒ๐˜.

If you need my help, check my services here (especially resume, profile review, and career guidance).

๐—ช๐—ฎ๐—ป๐˜ ๐˜๐—ผ ๐—•๐—ฒ๐—ฐ๐—ผ๐—บ๐—ฒ ๐——๐—ฎ๐˜๐—ฎ ๐—ฆ๐—ฐ๐—ถ๐—ฒ๐—ป๐˜๐—ถ๐˜€๐˜ ๐˜„๐—ถ๐˜๐—ต๐—ผ๐˜‚๐˜ ๐˜€๐—ฝ๐—ฒ๐—ป๐—ฑ๐—ถ๐—ป๐—ด ๐—ฎ๐—ป๐˜† ๐˜€๐—ถ๐—ป๐—ด๐—น๐—ฒ ๐—ณ๐—ฒ๐—ฒ ๐˜„๐—ฎ๐—ป๐˜ ๐˜๐—ผ ๐—ธ๐—ป๐—ผ๐˜„ ๐—บ๐—ผ๐—ฟ๐—ฒ ๐—ฎ๐—ฏ๐—ผ๐˜‚๐˜ ๐—ถ๐˜, ๐—ฏ๐—ผ๐—ผ๐—ธ ๐—ฎ ๐—ณ๐—ฟ๐—ฒ๐—ฒ ๐—ป๐—ผ๐˜„ ๐—ฐ๐—ฎ๐—น๐—นโ€Šโ€”โ€Šhttps://bit.ly/3GnZ8j4

If you like this article then please consider following me on medium (deepakchawla). if youโ€™d like to be notified of every new post and donโ€™t forget to follow me on Linkedin Website.

Other articles on Medium you may like:

[Roadmapโ€Šโ€”โ€ŠFront-End Developer (HTML, CSS & JS)
When anyone in the world solving any problem with the help of the technology so they need some platform where they canโ€ฆmedium.com](https://medium.com/hidevs-community/roadmap-front-end-developer-html-css-js-6784aead02aa "medium.com/hidevs-community/roadmap-front-e..")

[Road-map for IT College Students
India has long demonstrated its mettle in the IT sector with the world looking to the nation for some form of ITโ€ฆhidevscommunity.medium.com](https://hidevscommunity.medium.com/what-are-some-tips-for-it-freshers-bba3d7e0cb3 "hidevscommunity.medium.com/what-are-some-ti..")

[How AI can be used in combating Covid-19.
Since the first case was reported in Wuhan, China, coronavirus (COVID-19) has spread at an unprecedented rate. It wasโ€ฆhidevscommunity.medium.com](https://hidevscommunity.medium.com/how-ai-can-be-used-in-combating-covid-19-627bee0ac01e "hidevscommunity.medium.com/how-ai-can-be-us..")

[I have tried several times to learn to program but failed every time.
First, you have to ask some questions to yourself before start anything.hidevscommunity.medium.com](https://hidevscommunity.medium.com/i-have-tried-several-times-to-learn-to-program-but-failed-every-time-7711ca97910f "hidevscommunity.medium.com/i-have-tried-sev..")

[Twitter Sentiment Analysis
To understand the sentiment of a tweeter. Here we are going to train and develop a simple Twitter Sentiment Analysisโ€ฆhidevscommunity.medium.com](https://hidevscommunity.medium.com/twitter-sentiment-analysis-146f769bd329 "hidevscommunity.medium.com/twitter-sentimen..")

[10 Common Interview Questions and How to Answer Them
Interview practices are important because they help employers make informed hiring decisions and ensure that jobโ€ฆmedium.com](https://medium.com/hidevs-community/10-common-interview-questions-and-how-to-answer-them-324198091fd6 "medium.com/hidevs-community/10-common-inter..")

[Tips for Nailing Your Job Interview: From Preparation to Follow-Up
Job interview preparation is important because it helps you present yourself to potential employers in the bestโ€ฆmedium.com](https://medium.com/hidevs-community/tips-for-nailing-your-job-interview-from-preparation-to-follow-up-885e90c01de "medium.com/hidevs-community/tips-for-nailin..")

ย