LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 04-30-2012, 06:05 PM   #1
joejoe99
LQ Newbie
 
Registered: Apr 2012
Posts: 4

Rep: Reputation: Disabled
git branch changes are changing master?


Hi --

I am learning the revision control software git.

I create the repository, import some files into master, create a branch, checkout the branch, make changes on the branch files, add and commit them, and then return to the master branch and they are also part of the master branch, when I have not merged them.

Am I misunderstanding something w/ git?

I thought you could make changes to your branches and not have those changes go into master right away, or at all unless you merge them in?

Thanks very much! Cant wait to git the basics down! ;0)
 
Old 05-01-2012, 04:02 AM   #2
psisquare
Member
 
Registered: Sep 2004
Location: Germany
Distribution: Gentoo
Posts: 164

Rep: Reputation: 31
What you describe sounds like it should work as expected. Can you give the exact sequence of commands you used? Maybe there's a subtle error in one of them, or there was an error message you overlooked. You may also want to look at the output of "git branch" at each step and check that you'r really on the branch you think you are, and "gitk --all" in order to see a graphical representation of the state of the repository.
 
Old 05-01-2012, 03:56 PM   #3
joejoe99
LQ Newbie
 
Registered: Apr 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
psisquare, thanks for the reply!

i dont know what i was doing before produce what i wrote above, but now when i do it like this:

Code:
mkdir gitrepo
cd gitrepo
git init
touch test.txt
git add .
git commit -a
git branch testing
git checkout testing
ls (shows test.txt)
touch testing.txt
ls (shows test.txt and testing.txt)
git add .
git commit -a
git checkout master
ls (shows only test.txt)
so it works exactly how i thought it would and should!

thanks and if i notice what i was doing wrong before, ill post back or if i encounter it again.

appreciate the attention, psisquare!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can i update kernel source from git with my own changes in another branch Richard.Yang Linux - Software 16 09-25-2011 01:26 PM
[SOLVED] Can't install Git repo (I don't git git ) Nemus Linux - Software 3 05-20-2011 02:09 PM
[SOLVED] Copying Individual git Repositories To Master cmnorton Linux - Software 1 10-25-2010 07:18 AM
Git fatal: invalid reference: master fester225 Linux - Virtualization and Cloud 1 01-05-2010 10:41 PM


All times are GMT -5. The time now is 09:01 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration