[git] How to use Git?

I am an engineering student who spends most of his spare time watching TV rather than coding. So basically I have zero experience with any kind of version control system. My understanding is somehow they make distribution of projects easier.

I was looking into Blueprint CSS Framework, liked it and downloaded from their Git project page. Now, I know Git does much more than providing a link on their website. So my questions are the following:

  • How do I use Git properly to keep my Blueprint download updated? Say there is a new version, what do I do?
  • Can I update all Git downloads at the same time? Say I have Blueprint and other projects downloaded on my Mac, how can I update them efficiently?

I looked into Git guide, but it's mostly for the people who have much more experience than I have.

Thanks for help :)

This question is related to git

The answer is


Using Git for version control

Visual studio code have Integrated Git Support.

  • Steps to use git.

Install Git : https://git-scm.com/downloads

1) Initialize your repository

Navigate to directory where you want to initialize Git

Use git init command This will create a empty .git repository

2) Stage the changes

Staging is process of making Git to track our newly added files. For example add a file and type git status. You will find the status that untracked file. So to stage the changes use git add filename. If now type git status, you will find that new file added for tracking.

You can also unstage files. Use git reset

3) Commit Changes

Commiting is the process of recording your changes to repository. To commit the statges changes, you need to add a comment that explains the changes you made since your previous commit.

Use git commit -m message string

We can also commit the multiple files of same type using command git add '*.txt'. This command will commit all files with txt extension.

4) Follow changes

The aim of using version control is to keep all versions of each and every file in our project, Compare the the current version with last commit and keep the log of all changes.

Use git log to see the log of all changes.

Visual studio code’s integrated git support help us to compare the code by double clicking on the file OR Use git diff HEAD

You can also undo file changes at the last commit. Use git checkout -- file_name

5) Create remote repositories

Till now we have created a local repository. But in order to push it to remote server. We need to add a remote repository in server.

Use git remote add origin server_git_url

Then push it to server repository

Use git push -u origin master

Let assume some time has passed. We have invited other people to our project who have pulled our changes, made their own commits, and pushed them.

So to get the changes from our team members, we need to pull the repository.

Use git pull origin master

6) Create Branches

Lets think that you are working on a feature or a bug. Better you can create a copy of your code(Branch) and make separate commits to. When you have done, merge this branch back to their master branch.

Use git branch branch_name

Now you have two local branches i.e master and XXX(new branch). You can switch branches using git checkout master OR git checkout new_branch_name

Commiting branch changes using git commit -m message

Switch back to master using git checkout master

Now we need to merge changes from new branch into our master Use git merge branch_name

Good! You just accomplished your bugfix Or feature development and merge. Now you don’t need the new branch anymore. So delete it using git branch -d branch_name

Now we are in the last step to push everything to remote repository using git push

Hope this will help you


git clone your-url local-dir

to checkout source code;

git pull

to update source code in local-dir;



To answer your questions directly rather than pointing you at documentation:

1) In order to keep it up to date, do a git pull and that will pull down the latest changes in the repository, on the branch that you're currently using (which is generally master)

2) I don't think there's something (widely available) that'll do this for you. To update them follow 1) for all projects.


If you wish to update several git repositories in one command - i suggest that you read a little bit on repo.

About updating the repository, you can do it by:

git fetch
git rebase origin/master

OR

git pull --rebase

For more information about using GIT you can take a look on my GIT beginners guide


I think gitready is a great starting point. I'm using git for a project now and that site pretty much got the ball rolling for me.


You might want to start with an introduction to version control. This guide is specific to subversion, but the core concepts can be applied to most version control systems. After you have the basics, you can delve into the git guide.


this is my blog on git and its for beginners who want to get started on git. https://techxposers.com/git-for-beginners/


I really like the O'Reilly book "Version Control with Git". I read it cover-to-cover and now I'm very comfortable with advanced git topics.