git - How can I create remote repo and locate repo and do branch and diff? -


i create repo

git init my_remote_repo   git clone my_remote_repo git branch alex 

fatal: not valid object name: 'master'.

git diff origin/master master use '--' separate paths revisions, this: 'git <command> [<revision>...] -- [<file>...]' 

how can solve ?

when first create repo, it's in kind of weird, unusable state until first commit.

git init my_remote_repo 

now have repo in ./my_remote_repo directory. it's not bare repo, atypical remote; , you're accessing local repo (though might able access remotely well, if you've set way remote clients reach it).

so far that's ok, if little unusual.

but if @ repo, you'd find has no commits. "knows" default should on master branch, branch hasn't been "born" (it has no commits), , cause commands give errors.

cd my_remote_repo 

if you're @ git bash prompt, indicate you're on master. put initial content in directory, , can

git add . git commit 

in text editor pops up, enter commit message, save/exit; have commit in repo, , errors you're seeing won't occur.

(if want start no content in repo, above commit command fail, but

git commit --allow-empty 

will work in case.)

at point, can clone repo (though saying git clone my_remote_repo repo's parent directory, you've implied above, won't work because default put clone @ same path original.)


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -