-4

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,738
  • 21
  • 105
  • 131
Igor
  • 5,620
  • 11
  • 51
  • 103

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,147
  • 3
  • 23
  • 31
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,738
  • 21
  • 105
  • 131
xero
  • 4,077
  • 22
  • 39