开发者

Using git for the first time

I want to add a开发者_Python百科 project which is located in my documents into a git repository, is this do-able? Thanks, I've never used git before


In theory yes:

cd yourRep
git init .
git add .
git commit -m "first commit"

You might want to add a .gitignore first in order to not add every file in your directory.
Some of them might not be relevant: see "Started using git recently … just noticed clones of my files with ' ~ ' appended in the end… why is this happening" for instance.


Certainly. Start by navigating to the root folder of your project. Once you are there execute git init to initialize a git repository in place. This repository is empty. You will have to add the necessary resources before you can commit them.

Start with git add -i. This is an interactive way of adding new resources to the repository. If you wish to add all files then execute git add . instead. It would be a good idea to create a .gitignore file, add the patterns of unnecessary files to it and then do git add .

Once you are done, execute git commit.


free book

online and or buy book

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜