How to understand git remote message? -


i have create new local repository (using git init, followed adding , committing files). later added remote repository:

$git remote add br /home/user/work/git/bare/

i can see through command git remote -v git fetch br successful

when switch repo, gives following message:

$ git checkout br/master

note: checking out 'br/master'.  in 'detached head' state. can around, make experimental changes , commit them, , can discard commits make in state without impacting branches performing checkout.  if want create new branch retain commits create, may (now or later) using -b checkout command again. example:    git checkout -b new_branch_name  head @ a155c68... added makefile.in` 

i did not understand above text? 'detached head' state?

just add:

$ git branch  * (no branch)    master  $ 

i @ no branch, how/why?

you checked out commit pointed remote branch (you can list them using git branch -r). if it’s not pointed local branch, results in detached head. should set br/master upstream of local master.

git checkout master git branch -u br/master 

you can synchronize local , remote master branch using git push , git pull.


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -