- Как установить самую последнюю версию Git в Ubuntu
- Установка последней версии Git в дистрибутивах Linux, основанных на Ubuntu
- Настройка конфигурации Git (для разработчиков)
- В заключение.
- How to Update Git
- How to Check the Current Git Version?
- How to Update Git
- Update Git on Linux
- Update Git on Windows
- Update Git on Mac
- Bitbucket Support
- Knowledge base
- Products
- Jira Software
- Jira Service Management
- Jira Core
- Confluence
- Bitbucket
- Resources
- Documentation
- Community
- Suggestions and bugs
- Marketplace
- Billing and licensing
- Viewport
- Confluence
- Installing and upgrading Git
- Install or upgrade Bitbucket
- On this page
- Related content
- Still need help?
- Check your version of Git
- Install or upgrade Git on Linux
- Install or upgrade Git on macOS
- Install or upgrade Git on Windows
- derhuerst / intro.md
- This comment has been minimized.
- alhadhrami commented Nov 9, 2017
- This comment has been minimized.
- rgnest commented Jan 6, 2018 •
- This comment has been minimized.
- mithlesh4257 commented Jan 7, 2018
- This comment has been minimized.
- elseagle commented Jan 18, 2018
- This comment has been minimized.
- Kaarthick912 commented Mar 5, 2018
- This comment has been minimized.
- Aztechtcs commented Mar 11, 2018
- This comment has been minimized.
- Joshua56 commented Mar 30, 2018
- This comment has been minimized.
- Joshua56 commented Mar 30, 2018
- This comment has been minimized.
- reddyvenu commented Apr 10, 2018
- This comment has been minimized.
- imad-bouramana commented Apr 29, 2018
- This comment has been minimized.
- webbertakken commented Aug 15, 2018 •
- This comment has been minimized.
- oscrx commented Sep 13, 2018 •
- This comment has been minimized.
- Princewillsarlex commented Nov 15, 2018
- This comment has been minimized.
- adkumar321 commented Jan 18, 2019
- This comment has been minimized.
- DuncantheeDuncan commented Mar 9, 2019 •
- This comment has been minimized.
- NetJayNoob commented Mar 19, 2019
- This comment has been minimized.
- Anthomy1 commented May 30, 2019
- This comment has been minimized.
- Anthomy1 commented May 30, 2019
- This comment has been minimized.
- virgilwashere commented Jun 4, 2019
- Install git on Ubuntu
- This comment has been minimized.
- virgilwashere commented Jun 4, 2019
- This comment has been minimized.
- sagynov commented Jun 16, 2019
- This comment has been minimized.
- Knlsharma commented Jul 22, 2019
- This comment has been minimized.
- Lucifer8759 commented Jul 23, 2019
- This comment has been minimized.
- mark-nirdesh commented Dec 17, 2019
- This comment has been minimized.
- ocBruno commented Feb 14, 2020
- This comment has been minimized.
- CyberChick111 commented Mar 6, 2020
- This comment has been minimized.
- Phontera commented Mar 31, 2020
- This comment has been minimized.
- gprakarsh commented Aug 10, 2020
- This comment has been minimized.
- ASCassinda commented Aug 25, 2020
- This comment has been minimized.
- Cyber-Guy24 commented Sep 3, 2020
- This comment has been minimized.
- wajeehas commented Sep 13, 2020
- This comment has been minimized.
- derhuerst commented Sep 14, 2020
- This comment has been minimized.
- mahfudivan commented Sep 23, 2020
- This comment has been minimized.
- temoke-levelops commented Nov 5, 2020
- This comment has been minimized.
- mavaddat commented Dec 19, 2020
- This comment has been minimized.
- AssefaDemeke12 commented Dec 26, 2020
- This comment has been minimized.
- Poojap19create commented Mar 26, 2021
- This comment has been minimized.
- mavaddat commented Mar 29, 2021 •
Как установить самую последнюю версию Git в Ubuntu
Установить Git на Ubuntu очень легко. Git доступен в главном репозитории Ubuntu и вы можете его установить с помощью терминала:
Достаточно легко, не так ли?
Существует лишь небольшая проблема (которая может и не быть проблемой вовсе), и это версия Git’а, которую он устанавливает.
В системе LTS стабильность программного обеспечения имеет первостепенное значение, поэтому Ubuntu 18.04 и другие дистрибутивы часто предоставляют более старую, но стабильную версию программного обеспечения, которая хорошо протестирована с выпуском дистрибутива.
Поэтому, когда вы проверите версию Git’а, вы увидите, что на самом деле установлена версия, которая старше, чем текущая версия Git’а, доступная на сайте Git-проекта:
На момент написания данной статьи версия, доступная на сайте, была 2.25. Так как же тогда установить последний Git на Ubuntu?
Установка последней версии Git в дистрибутивах Linux, основанных на Ubuntu
Один из способов — установка из исходных текстов. Этот крутой старый метод — не для всех. К счастью, есть PPA, доступный от команды Ubuntu Git Maintainers, который вы можете использовать, чтобы легко установить последнюю стабильную версию Git.
Даже если вы ранее устанавливали Git с помощью apt, он будет обновлен до последней стабильной версии.
Прелесть использования PPA заключается в том, что если будет выпущена новая стабильная версия Git’а, то вы получите её с обновлениями системы. Просто обновите Ubuntu, чтобы получить последнюю стабильную версию Git’а.
Настройка конфигурации Git (для разработчиков)
Если вы установили Git для разработки, то вскоре вы начнете клонировать репозиторий, вносить изменения и коммитить их.
Если вы попытаетесь закоммитить свой код, вы можете увидеть ошибку ‘Пожалуйста, скажите мне, кто вы’, подобную этой:
Она возникает потому, что вы не настроили в Git’е свои персональные данные, которые являются обязательными.
Как уже подсказывает ошибка, вы можете настроить глобальную конфигурацию Git’а таким образом:
С помощью этой команды вы можете проверить конфигурацию Git’а:
Команда должна показывать такой выход:
Эта конфигурация хранится в файле
/.gitconfig. Вы также можете изменить её вручную.
В заключение.
Я надеюсь, что это краткое руководство помогло вам установить последнюю версию Git на Ubuntu. С PPA вы легко получите последнюю версию Git’а.
Если у вас есть какие-либо вопросы или предложения, пожалуйста, не стесняйтесь задавать их в разделе комментариев. Быстрые реакции и «благодарность» также приветствуется 🙂
Источник
How to Update Git
Git is a version control system that allows multiple developers to work on the same project while tracking changes and revisions. Keeping Git up to date brings you the latest features and usability improvements.
In this tutorial, you will learn how to update to the latest version of Git on Linux, Windows, and macOS.
- A system running Linux, Windows, or macOS
- An installed version of Git
- Access to the terminal window (Linux, macOS) or command prompt (Windows)
- An account with administrator-level privileges
How to Check the Current Git Version?
To check the current version of Git, use the following command:
This command works on all operating systems. This example uses Windows:
How to Update Git
Below, we list different ways you can update your version of Git, depending on the operating system you are using. Skip to the section applicable for your machine.
Update Git on Linux
Note: To update Git on a Linux machine, use the appropriate package manager. When working with Git on CentOS, use a package manager such as yum or pacman .
This example shows how to update Git on Ubuntu.
Start by updating the system packages with the following command:
Update Git by using:
When prompted, type Y and press Enter to confirm the installation.
To verify the installation has completed, check the Git version one more time:
Another way to update Git on Linux is to install it from scratch using the original source code. Check out our guide to installing Git on Ubuntu for details.
Update Git on Windows
The method you use to update Git on Windows depends on the version of Git you are currently running.
For versions prior to 2.14.1, uninstall Git from your system and install a copy of the latest version from scratch. Check out our guide to installing Git on Windows for more details.
For versions from 2.14.2 to 2.16.1, use the following command in your command prompt:
For versions 2.16.1 on, update Git with:
The output above appears when you are running the latest Git version.
Update Git on Mac
The easiest way to update Git on Mac is to use the official installer. Download the installation file from the Git website. Run the installation and follow the install wizard to update Git to the latest version.
Note: Using the install wizard to update Git overwrites the current installation.
Another method is to update Git using Homebrew. If you don’t have Homebrew already, install it by using:
Update Homebrew to make sure you have the latest installation packages:
Install the latest version of Git with Homebrew:
If you already have Git installed using Homebrew, update to the latest version with:
Check the current Git version to confirm the update:
Note: If checking the Git version after updating results in an output that includes (Apple Git-101) , your system is still running the default Apple version of Git instead of the official one. Change your local path to the Homebrew version of Git to fix this issue:
export PATH=/usr/local/bin:$PATH
After following this tutorial, you should have a fully updated version of Git installed on a Linux, Windows, or macOS machine.
Take a look at our Git Commands Cheat Sheet for a comprehensive primer on working with Git. If you come across a Git merge conflict, make sure to read our article How to Resolve Merge Conflicts in Git.
Источник
Bitbucket Support
Knowledge base
Products
Jira Software
Project and issue tracking
Jira Service Management
Service management and customer support
Jira Core
Manage any business project
Confluence
Bitbucket
Git code management
Resources
Documentation
Usage and admin help
Community
Answers, support, and inspiration
Suggestions and bugs
Feature suggestions and bug reports
Marketplace
Billing and licensing
Frequently asked questions
Viewport
Confluence
Versions
Installing and upgrading Git
Install or upgrade Bitbucket
On this page
Related content
Still need help?
The Atlassian Community is here for you.
[Security vulnerability CVE-2016-2324 & CVE-2016-2315] If you are running a Git version older than 2.4.11, 2.5.5, 2.6.6 or 2.7.4 (all released 17 Mar 2016 ), you should upgrade Git as soon as possible.
This page describes how to:
The information on this page applies to installing or upgrading Git on either your local machine, or on the Bitbucket Data Center and Server instance.
Check your version of Git
The versions of Git supported by Bitbucket are listed on Supported platforms .
You can check your current version of Git by running the git —version command in a terminal (Linux, macOS) or command prompt (Windows).
If you don’t see a supported version of Git, you’ll need to either upgrade Git or perform a fresh install, as described below.
Install or upgrade Git on Linux
Use your package manager to install Git. For example, on Ubuntu 13.10, use:
Alternative download options are:
- Download the latest stable Git release from the Git website.
- If you are using a different Linux distribution, you may need to use a different package repository to get the latest stable version of Git.
- If you need the most recent version of Git, you might need to install it from source.
Now check the Git version – you should see the new version of Git.
If you still can’t see the expected Git version, you may need to add the Git install location to your path. Open your
/.profile file in a text editor and add this line, where
is the install location for Git:
You can use the which git command to find the install location for Git.
Install or upgrade Git on macOS
Download the latest stable Git release from the Git website.
Click on the downloaded .dmg file, then double-click the .pkg icon to run the installer. This will install the new version of Git over the existing version:
Alternatively, you can:
- Use the native Git bundled with macOS.
- Use Homebrew to download and install Git.
Now check the Git version – you should see the new version of Git.
If you still can’t see the Git version, you may need to add the Git install location to your path. Open your
/.profile file in a text editor and add this line, where
is the install location for Git:
You can use the which git command to find the install location for Git.
Install or upgrade Git on Windows
Download the latest stable Git release from the Git website.
Run the Git installer, ensuring that you install into the same location as any existing Git installation. You can use where git to locate existing installations. Installing Git for Windows (msysGit) also installs a supported version of Perl.
To ensure that git.exe is available in the path, choose either:
- Run Git from the Windows Command Prompt, or
- Run Git and included Unix tools from the Windows Command Prompt.
Do not select Use Git Bash only when installing or upgrading Git for the Bitbucket instance — this will not work.
Now, check the Git version – you should see the new version of Git.
msysGit is the only supported distribution when running Bitbucket on Windows. Cygwin Git is not supported and has known issues.
If you have successfully installed msysGit but you receive the error «Unable to find git!» when installing Bitbucket, you should abort the installation, restart the Windows server, then restart the Bitbucket installation.
Restart Bitbucket if necessary
If you’ve been installing or upgrading Git for the Bitbucket instance, rather than for your local machine, you’ll need to stop and restart Bitbucket so that it will pick up the upgraded version of Git. See Start and stop Bitbucket for details.
Источник
derhuerst / intro.md
Installing Git – the easy way
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
Choose one of the following options.
Determine on which Linux distribution your system is based on. See List of Linux distributions – Wikipedia for a list. Most Linux systems – including Ubuntu – are Debian-based.
Debian-based linux systems
Open a terminal window. Copy & paste the following into the terminal window and hit Return . You may be prompted to enter your password.
You can use Git now.
Red Hat-based linux systems
Open a terminal. Copy & paste the following into the terminal window and hit Return . You may be prompted to enter your password.
You can use Git now.
Homebrew […] simplifies the installation of software on the Mac OS X operating system.
Copy & paste the following into the terminal window and hit Return .
You will be offered to install the Command Line Developer Tools from Apple. Confirm by clicking Install. After the installation finished, continue installing Homebrew by hitting Return again.
Step 2 – Install Git
Copy & paste the following into the terminal window and hit Return .
You can use Git now.
Installing Git on Windows
- DownloadGit from Git for Windows and install it.
This comment has been minimized.
Copy link Quote reply
alhadhrami commented Nov 9, 2017
Wrong link in ‘intro.md’ for «Instructions for Windows». I was going to create a pull request, but then remembered that doesn’t exist in gist.
This comment has been minimized.
Copy link Quote reply
rgnest commented Jan 6, 2018 •
You shoud before do «cd» the directrory should be yours home. Or will have error.
I mean macos.
This comment has been minimized.
Copy link Quote reply
mithlesh4257 commented Jan 7, 2018
Git is not installing in Ubuntu. Please help!
This comment has been minimized.
Copy link Quote reply
elseagle commented Jan 18, 2018
@mithlesh4257 try
sudo apt-get update then sudo apt-get upgrade followed by sudo apt-get install git
This comment has been minimized.
Copy link Quote reply
Kaarthick912 commented Mar 5, 2018
sudo yum upgrade
I ran this command and it removed all existing users. It upgraded like 450 packages and removed some users. Anybody know why this happened ?
This comment has been minimized.
Copy link Quote reply
Aztechtcs commented Mar 11, 2018
same problem here
This comment has been minimized.
Copy link Quote reply
Joshua56 commented Mar 30, 2018
I am having the same problem in my linux mint
This comment has been minimized.
Copy link Quote reply
Joshua56 commented Mar 30, 2018
zenity : Depends: libpango-1.0-0 (>= 1.14.0) but it is not going to be installed
Depends: zenity-common (= 3.18.1.1-1ubuntu2) but it is not going to be installed
E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or specify a s
This the error of the code
This comment has been minimized.
Copy link Quote reply
reddyvenu commented Apr 10, 2018
same problem here
This comment has been minimized.
Copy link Quote reply
imad-bouramana commented Apr 29, 2018
try this repository
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git
This comment has been minimized.
Copy link Quote reply
webbertakken commented Aug 15, 2018 •
I used this as a source for PracticalNotes — Homebrew.md because it is very efficient.
This comment has been minimized.
Copy link Quote reply
oscrx commented Sep 13, 2018 •
Wrong link in ‘intro.md’ for «Instructions for Windows». I was going to create a pull request, but then remembered that doesn’t exist in gist.
Exactly this 😀
But thanks for the guide.
This comment has been minimized.
Copy link Quote reply
Princewillsarlex commented Nov 15, 2018
This comment has been minimized.
Copy link Quote reply
adkumar321 commented Jan 18, 2019
sudo apt-get install aptitude
sudo aptitude install git
This comment has been minimized.
Copy link Quote reply
DuncantheeDuncan commented Mar 9, 2019 •
Thanks it now installed
But Git-it command doesn’t work and git-it verify
So what the next step please help
I’m using Kali Linux
This comment has been minimized.
Copy link Quote reply
NetJayNoob commented Mar 19, 2019
I am having issues with setting the port. When I type ‘set port 80’ I get back as an error: «you can’t set option ‘port’. Available options: [‘target’, ‘http_port'» etc. will this affect my check runs later?
This is on Kali Linux, and is after ‘set target 192.168. )
This comment has been minimized.
Copy link Quote reply
Anthomy1 commented May 30, 2019
Thanks it now installed
But Git-it command doesn’t work and git-it verify
So what the next step please help
I’m using Kali Linux
This comment has been minimized.
Copy link Quote reply
Anthomy1 commented May 30, 2019
I need help.
I’m using Kali Linux.
This comment has been minimized.
Copy link Quote reply
virgilwashere commented Jun 4, 2019
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git
Install git on Ubuntu
The most current stable version of Git for Ubuntu.
For release candidates, go to https://launchpad.net/
hub : use github from the command-line
hub is an extension to command-line git that helps you do everyday GitHub tasks without ever leaving the terminal
Hope that helps someone.
This comment has been minimized.
Copy link Quote reply
virgilwashere commented Jun 4, 2019
⚠️ Any additional repositories added to the Kali sources.list file will most likely BREAK YOUR KALI LINUX INSTALL.
If this doesn’t do it, I’d be real careful now.
This comment has been minimized.
Copy link Quote reply
sagynov commented Jun 16, 2019
This comment has been minimized.
Copy link Quote reply
Knlsharma commented Jul 22, 2019
Use this command to check your current Git version: git —version
This comment has been minimized.
Copy link Quote reply
Lucifer8759 commented Jul 23, 2019
I need help.
I’m using Kali Linux.
This comment has been minimized.
Copy link Quote reply
mark-nirdesh commented Dec 17, 2019
I need help.
I’m using Kali Linux.
why use shell ?
use sudo apt-get install git
This comment has been minimized.
Copy link Quote reply
ocBruno commented Feb 14, 2020
Just a heads up!
The Instructions for Windows is linking to the linux instructions
This comment has been minimized.
Copy link Quote reply
CyberChick111 commented Mar 6, 2020
@mithlesh4257 try
sudo apt-get update then sudo apt-get upgrade followed by sudo apt-get install git
This one worked!! Thanks
This comment has been minimized.
Copy link Quote reply
Phontera commented Mar 31, 2020
It worked! Thank you.
This comment has been minimized.
Copy link Quote reply
gprakarsh commented Aug 10, 2020
The link for the Mac Download is outdated. This is the one that should be used —
/bin/bash -c «$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)»
This comment has been minimized.
Copy link Quote reply
ASCassinda commented Aug 25, 2020
This comment has been minimized.
Copy link Quote reply
Cyber-Guy24 commented Sep 3, 2020
Thanks mark-nirdesh that worked for me as well
This comment has been minimized.
Copy link Quote reply
wajeehas commented Sep 13, 2020
I have tried installing homebrew via mac os terminal, but it keeps asking me for a password. does anyone know which password this is? it comes up as a key sign.
This comment has been minimized.
Copy link Quote reply
derhuerst commented Sep 14, 2020
I have tried installing homebrew via mac os terminal, but it keeps asking me for a password. does anyone know which password this is? it comes up as a key sign.
It looks like it uses sudo to install itself to a specific location on your computer; sudo requires your password. You will have to put your macOS user’s password.
This is badly designed, it should actually explain why it is using sudo .
This comment has been minimized.
Copy link Quote reply
mahfudivan commented Sep 23, 2020
I have tried installing homebrew via mac os terminal, but it keeps asking me for a password. does anyone know which password this is? it comes up as a key sign.
your laptop password, I use a macbook, I also enter my laptop password
This comment has been minimized.
Copy link Quote reply
temoke-levelops commented Nov 5, 2020
Works for Mac! Where do I give thumbs up?
This comment has been minimized.
Copy link Quote reply
mavaddat commented Dec 19, 2020
why use shell ?
use sudo apt-get install git
They (incorrectly) copied the entire markdown-laden code-block and pasted that into the bash terminal, which of course bash cannot interpret as a command. Do not paste the markdown (e.g., «`shell ) into bash — that part is just for formatting the code on GitHub.
This comment has been minimized.
Copy link Quote reply
AssefaDemeke12 commented Dec 26, 2020
git hub setup for linux
This comment has been minimized.
Copy link Quote reply
Poojap19create commented Mar 26, 2021
I am getting an error while installing git for UBUNTU Can anybody help please
This comment has been minimized.
Copy link Quote reply
mavaddat commented Mar 29, 2021 •
I am getting an error while installing git for UBUNTU Can anybody help please
Your Ubuntu version is no longer maintained. You need to update your distribution to a version that is within its support lifetime. For example, try using this upgrade combination:
Источник