Github.com is a famous repository hosting website, where you can share your git repositories with other people around the globe. By default, your code can freely be viewed by anyone across the globe, which is a really useful thing if you want to keep your project "open source" and want other people to contribute to it. However, if you have a paid account, you can keep your code hidden and available only to specific people whom you authorize to do so. Overall, it is a great tool, both for small softwares and also for gigantic programs.
Here, we present a tutorial that uses some of the most basic commands used in git.
=>First of all, install git by typing the following command inside your terminal:
sudo apt-get install git
=> git init
Typing this will initialise git and create a hidden folder named ".git" inside your current folder.

=>git add file.txt
And then:
git commit
This will "commit" whatever changes you made to file.txt. A COMMIT_EDITMSG file opens up. Type the description of the changes made and press Ctrl+O.

=>If you change a file's contents and then type git status, it will warn you that changes are not yet committed.
=>Type git log to see the description of all the changes you committed.

=>To revert/go back to a change you made, type :
git revert
where hash of the commit is the long numeric value written with each commit.
To know more, you can check out this great, interactive beginners tutorial on https://try.github.io/.
No comments:
Post a Comment