stackdot / NodeJS-Git-Server

A multi-tenant git server using NodeJS
387 stars 103 forks source link

Example on pushing changes to git repository #18

Open sbcd90 opened 10 years ago

sbcd90 commented 10 years ago

Hi,

Can you kindly provide an example on how we can push the uncommitted changes from my local git repo to the remote repo created by ?

Can I push to "master" branch?What should be origin here?

"http://127.0.0.1:7000/myrepo.git/" -- This origin doesn't work...

Kindly help.

Thanks in advance. Subhobrata

bugs181 commented 9 years ago

Try these commands to push a git repo to the master branch. You can have multiple git remotes, say different servers for development, production, etc. I'll explain what these commands do later.

$ git init
$ git remote add development http://localhost:7000/repo-name.git
$ git add --all
$ git commit -m "Your commit message"
$ git push development master
  1. Initialize a new project directory with git.
  2. This command will add the localhost git server as a development remote. This will later allow you to push to a particular git server by using the tag.
  3. This command tells git to add all file changes to the next commit.
  4. This command adds a commit message so you know what the last change to your repo was.
  5. This command finally pushes the committed changes to the development server on the master branch.

I hope this helps you.

Yamilquery commented 9 years ago

I can't make push... :(

Yamil:test Yamilquery$ git remote add development http://user:password@domain:7000/test.git Yamil:test Yamilquery$ git add --all Yamil:test Yamilquery$ git commit -m "test" On branch master nothing to commit, working directory clean Yamil:test Yamilquery$ git push development master Counting objects: 3, done. Writing objects: 100% (3/3), 220 bytes | 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) remote: : No such file or directory To http://user:password@domain.com:7000/test.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'http://user:password@domain.com:7000/test.git' Yamil:test Yamilquery$