Answer the question
In order to leave comments, you need to log in
How to get changes on a remote server?
Good afternoon!
With git zank not so long ago, the problem is that the scheme for working with a remote repository is not clear (do I need to make it empty -- bare ?).
Actually, I will give an example as I now understand the scheme of work, on the local.
create 2 folders:
The server folder will serve as the remote repository.
local, respectively local.
mkdir server
mkdir local
mkdir hello.git
cd hello.git/
git --bare init
Initialized empty Git repository in /your/folder/server/hello.git/
cd ../local
touch somefile.txt
git init
Initialized empty Git repository in /your/folder/local/.git/
git remote add origin /your/folder/server/hello.git/
git remote -v
origin /your/folder/server/hello.git/ (fetch)
origin /your/folder/server/hello.git/ (push)
git add -A
git commit -m "init commit"
[master (root-commit) acf9e28] init commit
1 file changed, 9 insertions(+)
create mode 100644 somefile.txt
git push origin master
Counting objects: 3, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 260 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To /your/folder/server/hello.git/
* [new branch] master -> master
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question