GIT help

General discussion for topics related to the FreeBASIC project or its community.
Post Reply
sancho3
Posts: 358
Joined: Sep 30, 2017 3:22

GIT help

Post by sancho3 »

Hello:
I am using Git_Cola on Ubuntu and would like to know how to do some things with it.
I have a repository and have files in it. I change a file and it shows up in cola that the file is changed.
I stage the file and drag it to the commit window. I title the commit and press commit. The file disappears and I go online and check but the remote file is not updated.
What step am I missing? What are the steps I need to take to get a file from my local repository to the remote repository?
Everything I have found on google just seems to dig me a deeper confusion hole.
Edit:
So I figured it out. The order is

Code: Select all

1. make changes to the file  
2. stage the files - the GUI will show you which files have been modified. You right click on it and select stage. 
3. drag the staged files into the commit window 
4. give the commit a message - this is required 
5. press the commit button 
6. in the branches pane  right click on the local repository ie the one on your hard drive - mine is local-master
    Select PUSH  
This will update the remote repository.
In my case the Head had become detached. This happened because I selected Checkout. Don't select checkout until you know why you would need to checkout.
Lots of new lingo to learn with regards to github. But the payoff is good.
St_W
Posts: 1619
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: GIT help

Post by St_W »

The important thing to keep in mind when using Git is that it's a distributed VCS. That means you can commit multiple times, but the commits are only performed on your local repository. You need to explicitly push changes to another repository (e.g. hosted on GitHub; but it could be just located on another PC or simply in a different folder on your PC). Likewise you also need to explictly pull changes from other repositories if you want to update your local one. You can define multiple storage locations of the repository, called "remotes", where you can push to or pull from.

While Git GUIs are nice for basic things and for visualizing the history I prefer using the git command line for everything else. It just needs some time to get used to it. Personally I don't like Git-Cola very much and prefer SmartGit (multi-platform) or SourceTree (win/mac) instead, but that's just my preference.
sancho3
Posts: 358
Joined: Sep 30, 2017 3:22

Re: GIT help

Post by sancho3 »

Thanks for the reply and good info.
Git-Cola is not at all intuitive and it is frustrating. I only went with it because it was the only one that showed up in the software center when I searched "git gui".
Git-Cola documentation seems to assume that the user is very familiar with the Git command line.
Stack Overflow posts I searched recommended an app specifically called "Git-GUI" but that was even less impressive.
I did try pushing commits via the command line, but with a detached head it wasn't happening. Once that was sorted, it all came together.
I have "Git Desktop" on my Win machine and that seems to be really nice.
I am going to stick with Git-Cola for now but I will keep your recommendations in mind.
Post Reply