我需要帮助git。 我有一个服务器,用户名和parol。我成功连接ssh但我无法添加文件。当我想使用git add bash添加文件(来自我的本地PC)时,returing无法找到文件路径或路径不存在。我认为它是在服务器中搜索文件或目录。
感谢。
答案 0 :(得分:0)
使用Git,您不能直接在服务器上创建存储库。相反,你
git init
),git add
)git commit
)git remote add
)
git push
)示例脚本:
$ cd your_local_project_dir/ # Get into your your project directory
$ git init # Initialize a local repository
$ git add --all # Stage all files from your local project
# directory for commit (note this is not
# adding to the repository yet, it's just
# "prepare them to add into the repo")
$ git commit -m "Initial commit" # Add the staged files to the local repository
$ git remote add origin https://server.com/user/project_name.git
# Link the local repository to a remote one
$ git push -u origin master # Upload you local repository data to the
# remote one