`

Git Commands

 
阅读更多
First person Setup
1. Set up a new repository from local to remote
git init
git add --all
git commit -m "Initial Commit from SVN migration"
git remote add origin ssh://git@cedt-icg-bitbucketcli.nam.nsroot.net:7999/ep/mfa.git
git push -f origin master

git config --global user.name "Your Name Comes Here"
git config --global user.email you@yourdomain.example.com
Git help clone

2. add submodule
git submodule add [repo URI] [folder name]
eg: git submodule add ssh://git@cedt-icg-bitbucketcli.nam.nsroot.net:7999/ep/portal-common.git portal-common

Other users to follow
1. Clone an existing remote repository to local
git clone ssh://git@cedt-icg-bitbucketcli.nam.nsroot.net:7999/ep/portal-project.git portal-project

2. close submodules as well if needed
Option a: After getting into submodule folder, run 'git submodule init' and then 'git submodule update'
Option b: directly pass --recursive to the git clone command in above step
eg. git clone --recursive ssh://git@cedt-icg-bitbucketcli.nam.nsroot.net:7999/ep/reverse-proxy.git reverse-proxy

Create a remote branch via local
git push -u origin 20160422_Release

Tag
git tag -a V1.0.0 -m 'tag test'
git push https://username:pwd@hostname/EsOrg/au-test7.git V1.0.0
git fetch origin tag trunk.12345 (fetch remote tag to local)

http://digitaldrummerj.me/git-sync-fork-to-master/
1) git fetch upstream: fetch all of the changes from the original repository. Note that commits to the original repository will be stored in a local branch called, upstream/master
2) git merge upstream/master

Remove latest commmit
1) git log -3 // show latest 3 commits
2) git reset --hard HEAD~1 (remove latest commit)
3) git push origin master -f

Reset remote origin
git remote set-url origin https://host/orgName/repoName.git

Checkout part of repository
svn export "https://github.wdf.sap.corp/{org}/{repo}/trunk/{path}"  ./{local_folder}/  --force
svn export "https://github.wdf.sap.corp/{org}/{repo}/branches/b1902/{path}"  ./{local_folder}/  --force

Git lfs
git lfs track *.json
git add .gitattributes
git less .gitattributes
git add EvolInstruct-Code-80k.json
git lfs ls-files -l
git commit -m "lfs commit"
git push

分享到:
评论

相关推荐

    git commands

    git commands

    Git Commands.pdf

    这份"Git Commands.pdf"文档显然是一个关于Git命令的总结,旨在帮助用户更好地理解和使用Git。以下是对文档中提到的一些关键Git命令的详细解释: 1. **git add**: `git add` 命令用于将更改添加到暂存区,准备进行...

    Git for Teams (2015)

    You can do more with Git than just build software. This practical guide delivers a unique ... The second part provides hands-on exercises to help developers gain a better understanding of Git commands.

    Git.Best.Practices.Guide.1783553731

    Starting with the basic Git commands, this book will take you on a journey to explore all the features of Git and provide you with a way to integrate Git in a team to set up Agile methods and ...

    Manning.Git.in.Practice.2014.9.pdf

    - **Rewriting History**: Using commands like `git reset` and `git rebase`, you can rewrite parts of the commit history. This should be done carefully to avoid losing important changes. - **Disaster ...

    Git2.10.0-32+TortoiseGit2.2.0.0官网版本-32-Bit-安装及配置

    同时,考虑勾选“Use Git Bash only for Git commands”,这样可以避免与其他系统命令冲突。 3. 配置Git:在安装完成后,打开Git Bash,设置用户名和邮箱,这是Git识别您的身份的关键信息。输入以下命令: ``` ...

    TortoiseGit+Git

    2. 先安装 Git,确保在安装过程中选择“运行 Git from the Windows Command Prompt”和“Use Git Bash only for Git commands”选项,以保持与命令行的兼容性。 3. 接着安装 TortoiseGit,安装过程中设置好 Git 安装...

    git-commands::laptop_computer:GITCommands是使用ElectronJS和ReactJS跨平台构建的桌面应用程序,可快速访问主要的Git命令并直接链接至文档

    Git Commands是一个桌面应用程序,使用跨平台的ElectronJS和ReactJS构建,可快速访问主要的Git命令并直接链接至文档。 屏幕截图 注意!! 您可以在下载适用于Mac和Windows的App。 建于 -ReactJS -ElectronJS -...

    Git-2.15.0-64-bit最新版本

    The release notes covering the history of the core git commands can be found in the Git project. See http://git-scm.com/ for further details about Git including ports to other operating systems. Git ...

    git命令参考pdf

    Git is the free and open source distributed version control system that's responsible for everything GitHub related that happens locally on your computer....used Git commands for easy reference.

    git-command-visualizer:100%Scala支持的Git命令可视化工具

    Git Commands Visualizer(Scala支持)主意我渴望与Scala一起做点事情。 事实证明,Git的概念很复杂,而我曾经遇到过理解它们的问题。 Git Commands Visualizer是我最卑鄙的工作,旨在帮助弥合复杂的git概念并通过...

    gitCommands:Git命令总结

    gitCommands gitCommands是在Platzi的Git和Github课程中创建的项目。 在其中,我描述了最常用的命令及其用法。 解释了如何使用github并介绍了Git中存储库的工作流程(即将推出) 。gitCommands的优点不断使用和练习...

    git cheat sheet

    We admit we can’t memorize all important Git commands – that’s why we created a nice cheat sheet for Git that we would like to share with you. On the front you can find all important commands. On ...

    常用的shell命令.pptx

    在IT行业中,Linux ...12. **git commands references**: 可以参考`https://git-scm.com/book/zh/v2`来学习更多Git命令和操作。 通过熟练掌握这些命令和工具,开发者能够更高效地进行日常开发、构建和自动化工作。

    asdf-git

    asdf-git 用于插件。 内容 依存关系 bash , curl , tar :通用POSIX实用程序。 SOME_ENV_VAR :在您的shell配置中设置此环境变量以加载正确版本的工具x。 安装 ...asdf plugin add git ...# Now git commands ar

    NodeJs-With-Git-Commands:Git命令

    NodeJs-With-Git-Commands Git命令 1)git init 2)git add * 3)git commit -m "First Commit" 4)git remote add origin th-Git-Commands.git 5)>git push -u 起源大师

    Professional Git [2017]

    Learn the Git versions of common source management concepts and commands Track changes, work with branches, and take advantage of Git′s full functionality Avoid trip–ups and missteps common to new ...

    git-commands:自定义高级用户git命令

    本资源"git-commands"旨在提供一些自定义的Git命令,帮助提升Git的使用体验。以下是关于自定义Git命令以及相关Git工具的详细知识点: 1. **Git钩子**: - Git钩子是在特定操作执行前或执行后运行的脚本,例如`pre-...

    开源项目-jesseduffield-lazygit.zip

    开源项目-jesseduffield-lazygit.zip,Lazygit - A simple terminal UI for git commands, written in Go with the gocui library

Global site tag (gtag.js) - Google Analytics