-3

I'm freelance developer and recently picked up the project that is hosted by Git. I decided to use a branch to work on my part. However I need some guidance as I never worked with Git before.

I did:

git clone <url_to_project>

and it gave me the source code in the directory ~/proj.

Now I need to pull the changes that was made and create a branch. The question is how do I do that?

Peter Mortensen
  • 30,030
  • 21
  • 100
  • 124
Igor
  • 4,957
  • 9
  • 45
  • 88

2 Answers2

3

To pull the changes from the remote master branch and merge it into your local master:

git pull origin master

To create a new branch new_feature:

git checkout -b new_feature

You change branches by checking it out without the -b flag, e.g.:

git checkout master
git checkout new_feature

A good tutorial (and in fact an online book) is: Pro Git

Nicholas
  • 2,099
  • 3
  • 23
  • 30
1

I suggest you actually learn to use the software.

There are a lot of great free resources out there... For example,

Peter Mortensen
  • 30,030
  • 21
  • 100
  • 124
xero
  • 3,870
  • 20
  • 39