I am learning Git
I have a website hosted on godaddy. Using 'Git Bash' tool, I initialized it into a git repo by using git init
.
THIS IS WHAT I DID (in detail)
Using Git Bash, I SSH into the remote godaddy servers as below
SSH [email protected]
, and then ran the following git commands to initialize the existing files as a git repo.
git init
, git add *
git commit
...
Now this is named as master
branch of the repo.
THIS IS WHAT I WANT TO DO
I want to pull this git repo to a local folder, make changes and then git push
it back.
THIS QUESTION IS OPENED AGAIN (here is why)
It is because answer by @dendress suggests that one should initialize the remote repo as bare
. Problem with this answer is that though it pushes successfully, but the changes are not reflected on the remote files.
TO SOLVE THIS IS WHAT I DID
Docs suggest that in a bare
repo there is no working tree. so changes can't be reflected. so what I did was
.git/
folder, git init
,git clone [email protected]
and made changesgit config --bool core.config true
git push origin master
Pareek@ram MINGW64 /c/wamp/www/git/sarv/sarv (master)
$ git push origin master
[email protected]'s password:
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 442 bytes | 0 bytes/s, done.
Total 5 (delta 4), reused 0 (delta 0)
To [email protected]:
8d4041d..7906308 master -> master
I think this means the push is successful, but **
**
You have to clone the repository to your local machine first. This can be done with the git clone
command like
git clone [email protected]:path/to/git/repo
After that you can do your edits and then push them back to the server with
git push origin
Note:
git init --bare
) since you want to push to it.git checkout -u branch-name
after cloning the repository.