git br和git st是通过~/.gitconfig设置的git别名,git br相当于是git branch。 [alias] st=status co=checkout br=branch ci= commit 以Ubuntu系统为例,修改~/.bashrc,在PS1变量之前增加如下代码 functiongit-branch-name { git symbolic-ref --short HEAD2>/dev/null}functiongit-branch-prompt { local bra...
在windows下用过git来进行代码管理的人都会喜欢git bash的一个功能:在命令行的末尾用颜色高亮现实当前工作的branch,然后在linux下默认安装的git工具是不具备此功能的,需要我们自己动手来实现此功能。以ubuntu为例,编辑用户主目录下的.bashrc文件,在文件的末尾加上如下代码就可以实现次功能了。 functionparse_git_branch...
local git_status=$(git status 2> /dev/null | tail -n1) || $(git status 2> /dev/null | head -n 2 | tail -n1); if [[ "$git_status" != "" ]]; then local git_now; # 标示 if [[ "$git_status" =~ nothing\ to\ commit || "$git_status" =~ Your\ branch\ is\ up\...
# Show git branch name force_color_prompt=yes color_prompt=yes parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' } if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033...
5. git push:将本地提交推送到远程仓库。 6. git pull:从远程仓库拉取最新的版本到本地。 7. git branch:查看分支信息。 8. git checkout [branch]:切换到指定分支。 9. git merge [branch]:将指定分支合并到当前分支。 10. git stash:将当前工作目录的修改保存到暂存区。
将该秘钥放到gitlab中的指定位置便可以使git与gitlab之间建立SSH通道 至此为止,git与gitlab之间便可以通过SSH通道联系。 git本地仓库关联gitlab远程仓库 在“Git Bash” 页面初始化本地仓库并与远程仓库建立联系 // 选择本地文件夹作为本地仓库并初始化
Linux系统下的Git Bash是一个在Windows环境下模拟Linux环境的工具,它提供了一个兼容层,使得开发者可以在Windows上使用原生的Linux命令行工具。Git Bash通常随Git for Windows一起安装,它是Git版本控制系统的一个组件。 基础概念 Git Bash是基于MSYS2环境构建的,它使用了一个轻量级的Unix-like环境,允许用户在Windows上...
apt-get -y install git git clone --depth=1 --branch=main https://github.com/armbian/buildcdbuild ./compile.sh Interactive graphical interface. Prepares the workspace by installing the necessary dependencies and sources. It guides the entire process and creates a kernel package or a ready-to-...
Linux系统下的Git Bash是一个在Windows环境下模拟Linux环境的工具,它提供了一个兼容层,使得开发者可以在Windows上使用原生的Linux命令行工具。Git Bash通常随Git for Windows一起安装,它是Git版本控制系统的一个组件。 基础概念 Git Bash是基于MSYS2环境构建的,它使用了一个轻量级的Unix-like环境,允许用户在Windows上...
1000+ DevOps Bash Scripts - AWS, GCP, Kubernetes, Docker, CI/CD, APIs, SQL, PostgreSQL, MySQL, Hive, Impala, Kafka, Hadoop, Jenkins, GitHub, GitLab, BitBucket, Azure DevOps, TeamCity, Spotify, MP3, LDAP, Code/Build Linting, pkg mgmt for Linux, Mac, Python, Perl, Ruby, NodeJS, ...