What to do after cloning repo from git

本秂侑毒 提交于 2019-12-03 07:20:36
David Culp

As jeremyharris said, the git documentation site and especially the online book there will get you up to speed on the basics.

A few quick notes that might get you past your initial issue.

git clone command is used to pull a copy (a clone) from an existing git repository. By default it creates a folder in the folder you execute it from that has a .git folder in it. The folder the cloning creates is your working copy and the .git folder is your local copy of the repository.

git clone is different than most other git commands. All (or most?) other git commands require the command to be executed within the working copy folder created by the clone. (Bare repositories are a bit different since they don't have working copies, but that shouldn't apply here.) So, after doing:

$ git clone <remote repo> <repo name> 

do:

$ cd <repo name>

to get into the working copy before executing any other commands. Executing commands outside of the working folder will get you the not a git repository message.

After making a change to a file, git add <filename> adds it to the index (marked to indicate ready to commit) and git commit -m '<commit message>' will then commit the changes.

You need to add the change at first, use git add .

You can also check the status before adding, by using git status

EDIT

Just saw the comments about error. Yes that's correct. I neglect that.

Your problem is you need to cd the git folder at first.

After that, you still need to add as my answer above.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!