https://forge.trustie.net/forums/1/memos/1231 #安装Git
https://forge.trustie.net/forums/1/memos/1438 #安装TortoiseGit
如下为通过命令行客户端Git来提交代码或文件的操作步骤[若您想使用git桌面版工具TortoiseGit来提交代码或文件请参见:通过TortoiseGit来提交代码或文件]:
图2
3、假设您要把桌面上示例文件夹myapp中的代码或者文件提交到Trustie版本库中,请首先在桌面空白处右击,选择“Git Bash Here”打开git命令行工具,如下图3:
(注意:如果右击没有显示’Git Bash Here’,可以在“开始”-->‘所有程序’找到Git Bash,如下图4)
命令五:git commit -m “my first commit” #将提交到暂存区的修改提交到本地的master分支(注意:“my first commit”中的内容是关于本次提交的解释,用户可以根据实际需要换成自己的解释语言)
命令六:git config http.postBuffer 524288000 #如果提交到本版的代码文件或者其他文件比较大,则需要运行该命令,将http.postBuffer的值设置为500M
命令七:git push -u origin master #git push 为远程推送功能,origin是远程版本库地址,master为本地分支。然后会提示输入用户名和密码(即Trustie平台登录用户名和密码)
如下图5:图6
备注:若您在工作过程中有临时任务需要在本地新建分支并在其上面进行开发,开发完毕后将该新的分支及新任务push到远端,则请参考:
如何在本地创建临时分支并将在临时分支开发的任务push到远端对应的临时分支?
欢迎您回复本贴进行提问,同样欢迎您拍砖,谢谢!
重新拉了一个有bug远程master分支到本地,通过revert重现有错误的那次提交,修改bug后push就可以了。
@黄井泉 我看了主分支
* master 4af9191 commit N+2
Username for 'https://git.trustie.net':***
Password for 'https://***@git.trustie.net':
Counting objects: 89, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (82/82), done.
Writing objects: 100% (89/89), 26.09 KiB | 0 bytes/s, done.
Total 89 (delta 23), reused 0 (delta 0)
remote: GitLab: You are not allowed to push code to this project.
To https://git.trustie.net/***/hww-ruby-advance.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.trustie.net/***/hww-ruby-advance.git'